Holiday Notice: Support will be provided on a limited scale from December 24th, 2024, to January 2nd, 2025. Happy holidays and a wonderful New Year!


Topic: Chart - SyntaxError: Cannot use import statement outside a module

ammi pro asked 3 months 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 3 months ago


We recommend using Charts v3 because this is version we tested and used during development of our components.



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • 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