title: Requirejs ignore loading error for optional dependency
body: <p>I'm using require.js and I load a library that handles tracking.  However, I have some users that block it from loading.</p>
  
  <p>Since its not a critical part of my app, I would like everything to still work, even when my tracking library fails to load.</p>
  
  <p>I've looked at the documentation for handling <a href="http://requirejs.org/docs/api.html#errors" rel="nofollow noreferrer">errors</a> via errbacks, config fallbacks, and the global onError function.</p>
  
  <p>I was thinking of something like:</p>
  
  <pre><code>requirejs.onError = function (err) {
       var modules = err.requireModules;
  
       for (var i = 0; i &lt; modules.length; i++) {
            if (modules[i] == 'tracking-lib') {
                 // Would be great if I could do something like define('modules[i]', [], null)
            }
       }
  };
  </code></pre>
  
  <p>Similar questions (that don't solve my problem):</p>
  
  <p><a href="https://stackoverflow.com/questions/14164610/requirejs-optional-dependency">requireJS optional dependency</a></p>
  
  <p><a href="https://stackoverflow.com/questions/15751642/null-dependencies-in-requirejs-when-ajax-returns-a-404">Null dependencies in RequireJS when ajax returns a 404</a></p>