Chartjs-Failed to load module script with Chart.js: MIME type of "text/html"

0👍

Only JavaScript (and JSON) modules can be imported.

The URL ./node_modules/chart.js/auto points to an HTML document, not a JavaScript module.

Glancing at the directory structure when I install that module from npm, auto is a directory, not a JavaScript module. Presumably your HTTP server is generating an HTML document containing a directory listing.

Likewise, "./node_modules/chartjs-plugin-zoom will also be a directory listing. The node_modules directory contains only directories (one per installed module).

Leave a comment