You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The whole story is a bit complicated and I'm not 100% sure what the fix should be...
We use requirejs as our AMD loader. This means that we shouldn't have window.System defined.
What triggered the issue is that corejs now contains a polyfill for System.global.
But by creating the System object, it fooled Aurelia into thinking that I have a System loader, which I don't. So the code crashes on the next line with System.normalizeSync is undefined.
Now, you might think "well, let's be more specific and test if (System && System.normalizeSync)". I think this would fix the short-term crash but I'm not sure if it's a long-term solution.
Consider this: in the future, what will happen when users finally upgrade to a modern browser that includes a built-in System loader?
Answer: Aurelia will think that I'm using the System loader... and nothing will work because I deploy optimized requirejs bundles.
I think it would be best if either:
Aurelia tests for the presence of requirejs first: if (window.require) else if (window.System). Since there is no reason requirejs would be loaded unless I'm intending to use it; or
Aurelia takes some explicit config at startup that says which loader I am using, no guessing game.
❗ This is a critical issue: without dirty work-arounds using Aurelia + latest corejs + requirejs simply does not work.
The text was updated successfully, but these errors were encountered:
This line of code inside
createLoader()
is now an issue for us, since the lastcorejs
update (2.0.2):bootstrapper/src/index.js
Line 47 in b6f1849
The whole story is a bit complicated and I'm not 100% sure what the fix should be...
We use requirejs as our AMD loader. This means that we shouldn't have
window.System
defined.What triggered the issue is that
corejs
now contains a polyfill forSystem.global
.But by creating the
System
object, it fooled Aurelia into thinking that I have a System loader, which I don't. So the code crashes on the next line withSystem.normalizeSync
is undefined.Now, you might think "well, let's be more specific and test
if (System && System.normalizeSync)
". I think this would fix the short-term crash but I'm not sure if it's a long-term solution.Consider this: in the future, what will happen when users finally upgrade to a modern browser that includes a built-in
System
loader?Answer: Aurelia will think that I'm using the
System
loader... and nothing will work because I deploy optimizedrequirejs
bundles.I think it would be best if either:
if (window.require) else if (window.System)
. Since there is no reason requirejs would be loaded unless I'm intending to use it; or❗ This is a critical issue: without dirty work-arounds using Aurelia + latest corejs + requirejs simply does not work.
The text was updated successfully, but these errors were encountered: