Yes, I know, this kind of question has been asked too many times. But I have a small detail which I would like to clarify.
We have one script tag in the body:
<script type="text/javascript" data-main="/js/app.87d28433.js" src="/js/external/requirejs/require.js"></script>
We use requirejs api for loading googleTagManager:
require(["//www.googletagmanager.com/gtm.js"], function () { ... })
However we have no control on the scripts that GTM loads and how it loads them. So, in the end, we get a lot of scripts tags in the body which load scripts, like FingerprintJS, which declare anonymous define modules.
Is it possible in any way to bypass this behavior and keep requirejs alive?
Once again, we have no way to control what and how scripts are been loaded by GTM.
Just add error handler for require.js errors:
requirejs.onerror = function() {
// do your error hadling stuff but don't throw exception!
}
(thanx to @maestro)