Chartjs-'require is not defined' error when attempting to use chartjs in javascript code

0๐Ÿ‘

โœ…

I recommend the cdnjs library imports. Just copy the link at the Chart.js-site and put it in your html-file.

<head>
  <title>Charts</title>  
  <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.8.0/Chart.bundle.js">
</head>

0๐Ÿ‘

If you are on node you need to npm install require.js. If you are not on node you can use ES6 Import.

Leave a comment