ng-chartjs
ng-chartjs copied to clipboard
No provider for StoreService
I'm facing a problem, when running with --prod flag I get this error in console after following your example here @93Alliance : (https://github.com/93Alliance/ng-chartjs/issues/21)
Any ideas how to fix it? without --prod flag it works pretty good but I need it to be prod valid, thanks! P.S. I've imported the module in a lazy loaded module, if I just import it in AppComponentModule it will not recognise the import.
I can't reproduce your problem, could you provide me with a demo?
Thanks for the response, the project is quite big I'm thinking of a way to showcase it to you... P.S. Did you tried with --prod? Maybe I don't have the package.json right versions....
yes, it works very well
You can try upgrade chart.js version to 2.9.3
"chart.js": "^2.9.3",


Apparently importing the two services like this fixed the prod issue....
What is your Angular version?
@93Alliance I'm also having the same issue raised by @ursedaniel .
My angular version is 8.2.1
Also I've tried to add StoreService in providers. But at that time I'm getting another error
Module not found: Error: Can't resolve 'ng-chartjs/lib/store.service'
What is your version of ng-chartjs?
"ng-chartjs": "^0.2.1"
I can use it normally in this demo https://stackblitz.com/edit/angular-8-ng-chartjs?file=src/app/app.component.ts
I've changed the my code with code in the above demo. Still the " no provider for storeService" error exists in browser.
Please provide me with your demo.
The StoreService is private, you can't export the StoreService from ng-chartjs
Then how can I use StoreService. Do I need to use the seperate folder as shown in git repo?
Why do you use StoreService?
I've implemented the ng-chartjs in a project that I'm working. When I'm running the project with --prod flag, I'm facing a problem as @ursedaniel mentioned in the issue. So, I just tried to import StoreService. If I can't import StoreService, then how will I solve the issue?
Could you provide me with a demo?
I can't share the project, but I will share a demo.
ok
I've implemented the ng-chartjs in a project that I'm working. When I'm running the project with --prod flag, I'm facing a problem as @ursedaniel mentioned in the issue. So, I just tried to import StoreService. If I can't import StoreService, then how will I solve the issue?
Do you enable ivy?
![]()
![]()
Apparently importing the two services like this fixed the prod issue....
This solution really helped with angular 8 prod build.