Topic: Chart - SyntaxError: Cannot use import statement outside a module
ammi pro asked 2 weeks ago
Updated chart.js to 4.4.4 in my project. I see error in console: "SyntaxError: Cannot use import statement outside a module at (program) (c:\source\myproject\node_modules\chart.js\dist\chart.js:7:1).
I added "type": "module", to package.json, but error is still there. What should I do?
Thank you
Arkadiusz Idzikowski staff answered 2 weeks ago
We recommend using Charts v3 because this is version we tested and used during development of our components.
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- ForumUser: Pro
- Premium support: No
- Technology: MDB Angular
- MDB Version: MDB5 6.1.0
- Device: Laptop
- Browser: Edge
- OS: W10
- Provided sample code: No
- Provided link: No