Reputation: 71
It's my tsconfig.js
{
"compilerOptions": {
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"moduleResolution": "node",
"target": "es5",
"module": "system",
"noImplicitAny": false,
"outDir": "built",
"rootDir": ".",
"sourceMap": false
},
"exclude": [
"node_modules"
]
}
i'm transpiling my 'hello-angular.ts' into 'hello-angular.js' using tsc
command. And import by System.import ('built/hello-angular')
When im starting server i've got err in browser
Unable to dynamically transpile ES module A loader plugin needs to be configured via
SystemJS.config({ transpiler: 'transpiler-module' })``
I'm dont understand, why systemjs trying to transpile es5 file.. I was set system.config({transpiler: false}) , but it didnt help..
Upvotes: 7
Views: 10161
Reputation: 1102
You need to add a transpiler as noted in the following answer:
Angular 2 - Unable to dynamically transpile ES module, angular2-google-map-auto-complete
In mine it looks like this in systemjs.config.js:
map: {
'plugin-babel': 'npm:systemjs-plugin-babel/plugin-babel.js',
'systemjs-babel-build': 'npm:systemjs-plugin-babel/systemjs-babel-browser.js'
},
transpiler: 'plugin-babel',
Upvotes: 4
Reputation: 2753
I was getting same error on one of the plugins:
Error: Unable to dynamically transpile ES module
A loader plugin needs to be configured via SystemJS.config({ transpiler: 'transpiler-module' })
.
Instantiating http://localhost:62362/node_modules/angular-star-rating/index.js
Resolved this error by replacing this line in systemjs.config.js:
'angular-star-rating': { defaultExtension: 'js', main: 'index.js' }
with this line:
'angular-star-rating': { defaultExtension: 'js', main: 'angular-star-rating.umd.js' }
Upvotes: 0
Reputation: 52837
Try the following in your tsconfig.json:
"module": "commonjs",
Upvotes: 1