I’m trying to use Chart.js in a custom made wordpress theme. I installed the package according to the step-by-step guide on the website of Chart.js. In my main theme folder I now have the folder node_modules.
In my main.js file I want to add the javascript to setup the graph, but I get an error at the first line in my js file: import Chart from ‘chart.js/auto’;
The error I get says: Mixed Content: The page at ‘https://www.xxxxxxxxxxxxxxxxx.io/’ was loaded over HTTPS, but requested an insecure script ‘http://www.xxxxxxxxxxxxxxx.io/wp-content/themes/xxxxxxxxxxxxxxxxtheme/js/node_modules/chart.js/auto/’. This request has been blocked; the content must be served over HTTPS.
How can I fix this?
Regards,
Sebastiaan
I have entered the code exactly like the instructions of the step-by-step guide.