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

369
Views
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 answers
Answer question

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 Report
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!