Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

162
Views
Parceljs bundler not recognizing scripts in index.html

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"
  }
}
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!