Import plotly from ... not working!

Hi, I have a svelte file which launches a web app, i’m trying to make component hierarchy and store something in a different file (as i’m having issues with the id being initialized before doing graph updates).
In the svelte app terminal I’ve done npm install plotly.js-dist, and in the code i use ‘import Plotly from ‘plotly.js-dist’’ which works. In the new file I installed it as well (in the terminal) and everything was underlined until I added ‘import Plotly from ‘plotly.js-dist’’ , however the ‘plotly.js-dist’ part is now red underlined with the error saying it’s not a module.
I’ve tried using the entire path, using const Plotly = require('plotly.js-dist'), using <script src="path/to/plotly.js"></script> in the index.html tag, checking the file is in the dependencies, and is in the correct file, i deleted the plotly.js-dist files and re-installed/updated them but no luck.

Any thoughts?