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

371
Visualizações
Error: A script element with a defer attribute must not have a type attribute with the value module

I have this code in the <head>-section:

<script defer src="./static/js/main.js" type="module"></script>

The validator on validator.w3.org gives me the error: "A script element with a defer attribute must not have a type attribute with the value module."

The javascript works fine and I am trying to understand the reason for the error. What can I do to solve the error?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

I found the answer on https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script.

The defer attribute has no effect on module scripts — they defer by default.

The error message is a little bit confusing. It suggests there is something wrong with the type-attribute. It would be a little bit more clear if it would say something like: "A script element with a type attribute with the the value module should not have a defer attribute."

about 4 years ago · Juan Pablo Isaza Relatório
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