I am having issues with systemJS when I have a mapped dependency within my 'app' package calls require(). In my case anytime the mapped dependency @ngrx/store calls the require(./dispatcher) function the default extension 'js' is not added, and my browser throws an error of Uncaught SyntaxError: Unexpected token <.
Here is my systemJS config:
System.config({
packages: {
'app': {
defaultExtension: 'js',
main: 'bootstrap',
format: 'amd',
map: {
'@ngrx/store': '../libs/node_modules/@ngrx/store/dist/index.js'
}
}
}
});
System.import('app')
.catch(console.error.bind(console));
Here is the error from chrome dev tools:
angular2-polyfills.js:1243 Uncaught Uncaught Uncaught SyntaxError: Unexpected token <
Evaluating http://localhost:5000/libs/node_modules/@ngrx/store/dist/dispatcher
Evaluating http://localhost:5000/libs/node_modules/@ngrx/store/dist/ng2.js
Evaluating http://localhost:5000/libs/node_modules/@ngrx/store/dist/index.js
Error loading http://localhost:5000/app/bootstrap.jsZone.run @ angular2-polyfills.js:1243zoneBoundFn @ angular2-polyfills.js:1220Zone.run @ angular2-polyfills.js:1243zoneBoundFn @ angular2-polyfills.js:1220lib$es6$promise$$inteal$$tryCatch @ angular2-polyfills.js:468lib$es6$promise$$inteal$$invokeCallback @ angular2-polyfills.js:480lib$es6$promise$$inteal$$publish @ angular2-polyfills.js:451lib$es6$promise$$inteal$$publishRejection @ angular2-polyfills.js:401(anonymous function) @ angular2-polyfills.js:123Zone.run @ angular2-polyfills.js:1243zoneBoundFn @ angular2-polyfills.js:1220lib$es6$promise$asap$$flush @ angular2-polyfills.js:262
It appears to me that SystemJS is not adding the .js extension so an error is being thrown. If I manually add the .js in the @ngrx dependency the errors go away. Obviously, I don't want to do that, so trying to find a proper solution...
thanks in advance.
