Importing NPM Module JavaScript into web page issue

Hello everyone,

I am working on an extension and have hit a road block. I am trying to import a JavaScript module from the npm package FusionCharts into a webpage.

I am running into an issue where the script won't execute due to a MIME type being wrong.

The script is imported simple like:
import FusionCharts from "fusioncharts"


As you can see from the screenshot, the script is being injected into the webpage, but it is refusing to execute.

Any idea on how I can fix this? Is there a better way to inject scripts? I much prefer this method if possible due to being able easily update the script in the future.

Full source code can be seen on the Flights tree here: https://github.com/BWBama85/airline-club-plus/tree/flights
Screenshot_from_2023-06-06_16-40-41.png
GitHub
Contribute to BWBama85/airline-club-plus development by creating an account on GitHub.
GitHub - BWBama85/airline-club-plus at flights
Was this page helpful?