I'm bundelling my code with parceljs but from some reason it is unable to recognize some scripts that I have in my index.html file. The scripts have the type="module" set on them and I also tried adding the type="module" as a top-level attribute in the package.json file. So everytime that I bundle the code and run it on http://127.0.0.1:1234/ I get the "Uncaught SyntaxError: Cannot use import statement outside a module" error and the scripts won't load although other scripts do load (bootstrap and controller.js). I will also add that when I run the code using the VS code live-server extension, the scripts load just fine. Any thoughts?
The scripts:
<script
type="module"
src="https://widgets.api-sports.io/football/1.1.8/widget.js">
</script>
<script
type="module"
src="https://unpkg.com/ionicons@5.5.2/dist/ionicons/ionicons.esm.js"
></script>
package.json:
"name": "footballstatsil",
"version": "1.0.0",
"description": "A website for football statistics",
"default": "controller.js",
"type": "module",
"scripts": {
"dev": "parcel index.html",
"build": "parcel build index.html"
},
"author": "Dror Salomon",
"license": "ISC",
"dependencies": {
"axios": "^0.24.0",
"parcel": "^2.0.0"
}
}