The instructions on http://www.chartjs.org/docs/latest/getting-started/integration.html show chart.js being imported as an es6 module:
When I use this import statement within a module using chrome latest, it fails:
import Chart from ‘https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.1/Chart.js‘
The error is:
Uncaught SyntaxError: The requested module does not provide an export named ‘default’
I think this is a bug, the docs say it should work. However, looking at the code, I see no es6 export.
It fails with the above error.
You might try converting to an es6 build using rollup for all conversions to other modules.
Steps to Reproduce (for bugs)
- Within a browser supporting modules, create a
- Inside that, import Chart.
- The error will occur.
<html> <head> <title>test</title> </head> <body> <script type="module"> import Chart from 'https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.1/Chart.js' console.log(Chart) </script> </body> </html>
I am using chart.js to visualize results of agent based models. The repos are:
- Chart.js version: latest .. 2.7.1
- Browser name and version: chrome 63.0.3239.132
- Link to your project: Above.