I'm using require.js and I load a library that handles tracking. However, I have some users that block it from loading.
Since its not a critical part of my app, I would like everything to still work, even when my tracking library fails to load.
I've looked at the documentation for handling errors via errbacks, config fallbacks, and the global onError function.
I was thinking of something like:
requirejs.onError = function (err) {
var modules = err.requireModules;
for (var i = 0; i < modules.length; i++) {
if (modules[i] == 'tracking-lib') {
// Would be great if I could do something like define('modules[i]', [], null)
}
}
};
Similar questions (that don't solve my problem):