Alberplz / angular2-color-picker

Angular 2 Color Picker Directive, no dependences required.
MIT License
185 stars 82 forks source link

Using color picker with Angular 2.1.0 causes problems #46

Closed garethlewis closed 7 years ago

garethlewis commented 7 years ago

After including the ColorPickerModule in my AppModule class. Any attempt to use the Color Picker with a webpack compiled app produces the following message in console.

Uncaught Error: Unexpected value 'e' imported by the module 'AppModule'(…)

Not particularly useful I know. Can you give me a rough guide as to when the Color Picker will be moving towards Angular 2.1.0?

The problem does not occur with SystemJS, but that is expected, as SystemJS does not package up the requisite parts from the angular node modules.

Also strangely, when not including the color picker and not uglyfying the code, the app.js chunk is 34kb. When including colorpicker and using Angular 2.1.0, the app.js is 900kb. It appears as if the the entire of the Angular 2.0.0 system that the color picker requires is included in app.js.

sanohin commented 7 years ago

It fails with Angular 2.0.0 with error "Uncaught Error: Unexpected value 'e' imported by the module 'AppModule'(…)" while the previous version failed with "Uncaught Error: Unexpected value 't' imported by the module 'AppModule'(…)". I use webpack to build an app.

garethlewis commented 7 years ago

For some reason, if I use Angular 2.0.0 and webpack it does work, but from Angular 2.0,1 onwards it fails. I can only guess as to what has changed, but the Angular 2 did introduce AOT, though that could be a red herring in this case.

Alberplz commented 7 years ago

There is a example with webpack in the project. I've compiled with Angular 2.0.0 and Angular 2.1.0 and it works

garethlewis commented 7 years ago

Thanks, I have just updated my project to use version 1.3.0 and it now loads the color picker correctly.

stevenxxiu commented 7 years ago

It's started to fail again as of angular 2.2.3 with the same error in the first post , here are my versions:

"@angular/common": "^2.2.3",
"@angular/compiler": "^2.2.3",
"@angular/core": "^2.2.3",
"@angular/forms": "^2.2.3",
"@angular/http": "^2.2.3",
"@angular/platform-browser": "^2.2.3",
"@angular/platform-browser-dynamic": "^2.2.3",
"@angular/router": "^3.2.3",
"angular2-color-picker": "^1.3.0",
bengle commented 7 years ago

In version 2.2.0 , I get this error again.

avoliva commented 6 years ago

I'm getting this error too. I'm using the latest version of angular which as of right now is 5.0.2.

I'm assuming this library hasn't been updated for angular 4