angular2-notifications icon indicating copy to clipboard operation
angular2-notifications copied to clipboard

SystemJS - Unable to dynamically transpile ES module

Open AdamSGit opened this issue 8 years ago • 5 comments

I'm not sure if the issue is related with my SystemJS setup or the module in itself. That being said, I run into to following error when adding angular2-notifications to the systemjs config :

Error: Unable to dynamically transpile ES module
A loader plugin needs to be configured via "SystemJS.config({ transpiler: 'transpiler-module' })"

I use the latest SystemJS module (0.20.14)

The part of systemjs config :

paths: {
      // paths serve as alias
      'npm:': 'node_modules/'
},
map: {
      'angular2-notifications': 'npm:angular2-notifications',
      ...
},
packages: {
     'angular2-notifications': { 
        main: './dist/index.js', 
        defaultExtension: 'js' 
    },
    ...
}

AdamSGit avatar Jul 03 '17 22:07 AdamSGit

Found why : The module is compiled in es2015, which is apparently not supported by systemjs without external transpiler configured. I guess SystemJS is kinda dead now...

May I ask you why you chose to switch from commonjs to es2015 ? Simple curiosity.

You can close the issue anyway, thanks again for your awesome module btw.

AdamSGit avatar Jul 06 '17 14:07 AdamSGit

Hey Adam, I face the same problem! Is there a workaround to use this module with SystemJS?

harishachar avatar Jul 10 '17 08:07 harishachar

Well you have multiples solutions :

  • You can configure a transpiler (typescript, babel...) inside SystemJS
  • You can change es2015 to commonjs into the module tsconfig file and compile it again (But when updated, you have to do it again)
  • You can migrate your project on ng-cli environment (That's what I did, and beside it's awesome, way better than SystemJS)

AdamSGit avatar Jul 10 '17 10:07 AdamSGit

I have the same issue and I was unable to get any of the solutions to work, that @AdamSGit suggested

pkoecker avatar Jul 27 '17 09:07 pkoecker

I had a similar issue and this seems to be fixed with the newly released 0.7.6

bomberblue07 avatar Jul 31 '17 21:07 bomberblue07