bower amd/index.js reference to System.js causes exception
trying to get aurelia setup via bower and require js. require(["aurelia-bootstrapper"]) throws an exception
Uncaught (in promise) ReferenceError:
System is not defined {stack: (...), message: "System is not defined"}message: "System is not defined"stack: "ReferenceError: System is not defined↵ at ensureLoader (http://localhost:59184/bower_components/aurelia-bootstrapper/dist/amd/index.js:62:14)↵ at http://localhost:59184/bower_components/aurelia-bootstrapper/dist/amd/index.js:225:14"get stack: function () { [native code] }arguments: nullcaller: nulllength: 0name: ""prototype: StackTraceGetterconstructor: function () { [native code] }proto: Object__proto__: function Empty() {}
Do we need System JS even when loading from bower? Or am I missing something?
This appears to be a bug.
In loader-default a light shim for System is defined here : https://github.com/aurelia/loader-default/blob/master/src/index.js#L6-L16 but in there is no explicit dependency on aurelia-loader-default here https://github.com/aurelia/bootstrapper/blob/master/src/index.js#L1-L3 module. It implies an error on System reference call when aurelia-bootstrapper load here : https://github.com/aurelia/bootstrapper/blob/master/src/index.js#L65
I think that add an import statement to aurelia-default-laoder in header could solved the issue but I'm not sure if it is compliant with the aurelia-bootstapper design ?
I'll take this issue. I'd like to see if there's a way to resolve this without a hard connection to the default-loader.
I just pushed the fix to the bootstrapper. I'm about to make a bootstrapper release. This should be available in just a few minutes.