Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

163
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda