It seems that in beta 12 Google removed @View directive from angular2/core. When I run TypeScript transpiler, it generates an error.
Unable to compile TypeScript
node_modulesng2-chartscomponentschartscharts.ts (2,14): Module '"C:...node_modules/angular2/core"' has no exported member 'View'.
2305)
So I see that an hour before I submitted this issue, ng2-charts was changed and all reverences to @View were removed. I downloaded the new version, via npm install https://github.com/valor-software/ng2-charts.git --save but it seems that it only contains TypeScript. When I go to run my application, an ng2-charts.js is not found. Any suggestions on how to proceed?
it depends on how are you consuming ng2-charts
webpack? system.js?
and small hint npm install -S valor-software/ng2-charts :)
I am using system.js but it probably be helpful to know how to use both, system.js and webpack
the things is, you can sonsume .js or .ts
for system.js you will need to configure typescript builder
This is what my modified system.config looks like:
System.config({
"defaultJSExtensions": true,
"packageConfigPaths": [
"/node_modules/_/package.json"
],
"paths": {
"main": "/main",
"angular2/_": "/angular2/_",
"rxjs/_": "/rxjs/_",
"moment/_": "/node_modules/moment/moment",
"_": "/node_modules/_",
"angular2-jwt": "/node_modules/angular2-jwt/angular2-jwt",
"ng2-charts": "/node_modules/ng2-charts"
},
"packages": {
"angular2": {
"defaultExtension": false
},
"rxjs": {
"defaultExtension": false
},
"ng2-charts": {
"defaultExtension": false
}
}
})
Yet, I am still getting an error
localhost/:105 Error: SyntaxError: Unexpected token <
at Object.eval .........
Evaluating http://localhost:5555/node_modules/ng2-charts/ng2-charts
......
"Report this error at https://github.com/mgechev/angular2-seed/issues"
I am getting the same error @jgenchik did you solve it?
@valorkin any fix for this yet?
@devangvt I have just updated ng2-bootstrap to beta.12
now I will update it to 13 and will be updating all other modules
sorry for so long waiting time
/node_modules/ng2-charts/components/charts/charts.ts (2, 14): Module '"/node_modules/angular2/core"' has no exported mng 'View'.
Just updated to beta.13, running into what appears to be the same or similar problem.
@devangvt no, I didn't solve it. I just stopped using ng2-charts.
Same issue here with ng2-charts 1.0.0-beta.0 and angular2.0.0-beta.14, i will have to install from repository, there's a commit to fix this just that isn't released to npm yet: Remove Reference to 'View'
@valorkin I didn't know it was so easy to install from repo, i always tough i had to use the git url, thanks: https://github.com/valor-software/ng2-charts/issues/100#issuecomment-200889929
Ok using npm package from git repo now shows in webpack error TS2307: Cannot find module 'ng2-charts'., any idea why?
Can this get bumped to beta 14 and have a tag cut please. Trying to use this.
@valorkin do you know how to npm install from the dev branch? i would like to test this to see if this fixes some issues i have with the beta.0 release.
@Luchillo npm install git://github.com/valor-software/ng2-charts.git#development --save should work
@zackarychapple it is published to npm
@Luchillo so you can install it from there
Most helpful comment
Can this get bumped to beta 14 and have a tag cut please. Trying to use this.