-
-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot find module 'chartist' still an issue? #37
Comments
This looks like an issue with the typings, I have been having the same issue. I just set typescript to still emit on error. I have been wanting to check on the typings to figure out the issue, but haven't had a chance. |
I had a look at the compiler options www.typescriptlang.org but couldn't find a suitable option. This is my tsconfig.json. Is it correct that "node_modules" is excluded? Removed it but it didn't make a difference though.
|
What version of typescript?
|
|
I still get this error and I am on 2.0.2. I think this is an issue better filed against the typings for Chartist personally. Something about the way they are being exported isn't right. |
Do you want me ro open an issue on the chartist github? You mentioned a workaround to set tsc omitting on error. Do you have the compiler option at hand? |
I would probably file it against https://github.com/DefinitelyTyped/DefinitelyTyped |
Ah, don't think I can do that. Not able to draw the right conclusions here. |
Ok, a bit of progress. I installed the chartist typings (wasn't aware that I had to do that) |
Ah well, yes. I guess I assumed the typings had been installed. In order to trace down that error, I'm gonna need a plunkr or fiddle so I can see the code. |
Uh, spent the entire afternoon to figure out how I could replicate my environment in plunker. But I don't see how I could create a complete new Ionic plunk (or use an existing Ionic 2 plunk ) and install, chartist, angular2-chartist + typings. Any alternative for trouble shooting? |
I just installed it and tried to use it with angular-cli. getting the same error |
Did you install the relevant typings? |
I will probably add a section to the README about typings, I think I had If either of you are also willing to add to the README, I'll be happy to On Tue, Sep 20, 2016 at 5:09 AM Jens Strümper notifications@github.com
|
Happy to do so. Don't see a difference for installing them between TS 2.0 and TS 1.8 though. In both cases I would do:
|
There actually is a difference in 2.0 So it would actually be |
Tried to progress on plunker. I though uploading the content from the build directory and adjusting the script links in the index html would be the best way forward but I could not even save the 4.5 mb app.bundle.js. Any advise or links you can share? |
Ok, getting a bit desperate on the plunker thing. Created a repository and uploaded my Ionic chartist-test www directory. Changed the script links to match the github raw links but no success. |
@struempelix alright, lets try and keep it simple then. Are there any code snippets you can paste me? Ideally I'd like to see:
Is this possible? |
Yes. It's a simple setup. Ionic 2 latest beta with chartist, angular2-chartist & typings installed. Your example code incorporated into the vanilla Ionic2 template. app.ts: (no changes here)
home.ts (incorporated the example code)
No additional HTML or TS files. This is the console log: |
It seems like you are missing data in Is that defined elsewhere? |
I don't know what I expected to see. An empty chart maybe? So yes, I didn't specify any data. I updated the example with some data and it is working! For reference, this is my updated code:
The chart line is a bit "distorted" but I guess I need to play with the responsive options. Although angular beginners typically don't play a lot with charts I would find it nice to have a complete example in the docs. On the other hand this would make the documentation more verbose. If you like I would propose an update with my example minus the Ionic stuff. Anyway - thanks for your support and patience! |
Yeah, the chart won't do anything without at least a
I agree. A copy-pastable example is always good. I can also make that update unless you'd like to. I think just adding some fake data and a type to the existing example would be good. Glad you were able to resolve it. Not a problem. |
Hi there,
I'd like to use angular2-chartist in an Ionic 2 app but I get a Typescript error when running the example code:
TypeScript error: /Users/jens/Development/Ionic/chartist-demo/node_modules/angular2-chartist/dist/chartist.component.d.ts(2,27): Error TS2307: Cannot find module 'chartist'.
There was a similar issue reported twice and was fixed in version 0.6.0. Any idea why I still get this error?
Thanks,
Jens
The text was updated successfully, but these errors were encountered: