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

199
Views
NextJs import external script with modulepreload and with type='module' defer

i've to import external scripts for advertisement. The company sent me e-mail saying i have to import this scripts :

<link rel='modulepreload' href='https://xy.js' />
<script type='module' defer src='https://xy.js'></script>

Now with nextjs i'am trying to import the script like so:

  <Script
    src="https://xy.js"
    strategy="beforeInteractive"
  />

and i get this error :

Uncaught SyntaxError: Cannot use import statement outside a module

How can i import those scripts?

about 4 years ago · Santiago Trujillo
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!