Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

165
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda