flauc / angular2-notifications

A light and easy to use notifications library for Angular.
https://stackblitz.com/edit/angular2-notifications-example
MIT License
746 stars 164 forks source link

SystemJS - Unable to dynamically transpile ES module #221

Open AdamSGit opened 7 years ago

AdamSGit commented 7 years ago

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 commented 7 years ago

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.

harishachar commented 7 years ago

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

AdamSGit commented 7 years ago

Well you have multiples solutions :

pkoecker commented 7 years ago

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

bomberblue07 commented 7 years ago

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