Open fahad-nxvt opened 7 years ago
i just upgraded from angular 2.1 to 2.3 and i'm getting the same error.
fixed. i npm uninstalled then re-installed the package and that fixed it.
I also just updated from angular 2.1 to 2.3 and I'm also getting this error. I uninstalled and re-installed the package and the error persists. Deleted node_modules and re-installed and still I'm still getting the error. Any idea?
I uninstalled and installed it many times but no luck.
I have the same error ... uninstalling / reinstalling does not help
any luck anyone?
i get the error "Unexpected Value 'e' in Modules..." using Angular2, TypeScript with WebPack. Installed colorpicker with npm
You're getting that error as the color picker is tied to Angular 2.1.0, is there was a change such as 2.1.1 onwards it would work, but the package.json has Angular referenced as ~2.1.0, so it will not use 2.2.0 or 2.3.0. If you're using SystemJS, you will not notice this problem, as it will download the version of Angular 2 needed for the color picker and also the version of Angular 2 for your app. The problem occurs when using Webpack. It is trying to consolidate the code into a single file, usually vendor.js, and this ends up being incorrect, as the differences between Angular 2.1.0 and Angular 2.2.0 will throw the packer off.
Hm.. any workaround for that? (As I assume it will always happen when my angular version is ahead of color-picker's angulas version?)
The only way I would recommend fixing this is to fork the repository and build from source yourself into a package that you can use. Then change the referenced version of angular to whichever version you need to use.
The pros: You are in charge of the Angular version used. The cons: Your fork will not contain any new changes made to the main repo. You will have to switch to that branch and merge in those changes to your fork. As long as your fork isn't too old, you should not have any problems. But if you start making changes to any of the files, you run the usual risk of merge conflicts which may be difficult to resolve without prior knowledge.
Hello all. Working in our team, we now have a modified version of this library that seems to be working in AOT-enabled build. That should address this present issue, as well as #40, #50, #61, #64.
@Alberplz would you consider discussing & eventually accepting a PR on such issue? I'm asking it as there are already a couple of our PRs that were either closed unmerged or left open.
Tnx
@BrainCrumbz Where can i find your build?
Just pushed, you can find it at ng2-aot-color-picker-sample together with some instructions. HTH
I have also a working AOT version and I plan to make PR as soon as I fix the example apps. I can post url to the github repo as soon as I have made the PR, the repo will have a npm-package branch that can be used to install the aot version through npm.
Thanks @sconix but in the npm-package branch the .js files aren't compiled, are the same .ts files
They are compiled, I can't see how they could be the same as ts files. The js files are produced by the ngc compiler. Or do you mean that they are not minimized which they should not be, that is task of the application compilation to pack the libraries.
And we use that branch ourselves in our product so its definitely works :)
I use webpack and this commit work for me git://github.com/zefoy/angular2-color-picker.git#cc12b8b516ce85f237ba62da4f7b75f731476ada
We use angular-cli in our project which uses webpack and the npm-package branch works nicely. There is also aot-fixes branch where you have the exact same build files as in npm-package and the both systemjs and webpack example apps work nicely when using the the build library from npm-package branch.
Hmm so thats the second last commit that is working for you, I will check if for some reason we don't have the latest commit in use and that if I somehow messed up the latest commit. All I know that I did test with the latest from aot-fixes branch and just copied the build files from there, but who knows if I managed to mess up that process.
Although I think the only difference between the last commit was that I removed the unnecessery ts files from the lib file, so are you sure that you have setup your project correctly and are using the build js files and not the ts files?
I am using angular-cli and angular2-color-picker but it is not working for me.
"dependencies": { "@angular/common": "^2.3.1", "@angular/compiler": "^2.3.1", "@angular/core": "^2.4.1", "@angular/forms": "^2.3.1", "@angular/http": "^2.3.1", "@angular/platform-browser": "^2.3.1", "@angular/platform-browser-dynamic": "^2.3.1", "@angular/router": "^3.3.1", "@types/socket.io-client": "^1.4.29", "angular2-color-picker": "^1.3.0", "chart.js": "2.3.0", "core-js": "^2.4.1", "moment": "2.15.2", "ng2-bootstrap": "^1.1.16", "ng2-charts": "1.4.1", "rxjs": "^5.0.0-rc.1", "ts-helpers": "^1.1.1", "zone.js": "^0.6.26" },
It is working for you?
There is a working version which can be installed from: git://github.com/zefoy/angular2-color-picker.git#npm-package
The released version is broken since angular-cli made the change that libs need to be AOT compatible. I have made a pull request and tried to contact the developer to get new release out but so far no luck.
@sconix It works very well. Thanks.
Please refer this: https://github.com/Alberplz/angular2-color-picker/issues/82
Updated angular to 2.3.0 and start getting this error
Unexpected value 'ColorPickerModule' imported by the module
Anyone knows how to fix this?