framework icon indicating copy to clipboard operation
framework copied to clipboard

bower amd/index.js reference to System.js causes exception

Open sujesharukil opened this issue 11 years ago • 4 comments

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() {}set stack: function () { [native code] }proto: ErrorensureLoader @ index.js:62(anonymous function) @ index.js:225

Do we need System JS even when loading from bower? Or am I missing something?

sujesharukil avatar May 14 '15 03:05 sujesharukil

This appears to be a bug.

EisenbergEffect avatar May 14 '15 04:05 EisenbergEffect

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 ?

npelletm avatar Jun 09 '15 16:06 npelletm

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.

EisenbergEffect avatar Jun 09 '15 16:06 EisenbergEffect

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.

EisenbergEffect avatar Jun 09 '15 16:06 EisenbergEffect