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

231
Views
When trying to use import statement I get Uncaught SyntaxError: Unexpected token '{'

I am making a website and I am trying to import a script. Whenever I try to import the script I get Uncaught SyntaxError: Unexpected token '{' . I am using express to show the website and it is just returning a html file.

This is the script tag that I am using to access the main script.

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

This is the code in the main file

.then(function(data) {
    data.forEach(function(currentdevice) {
    import { testvalue } from "./DeviceManager/" + currentdevice.Type;
});

Basically currentdevice.Type is the file name and I checked it is correct.

For the file that I am trying to import I just have a bit of example code why I try to get import to work.

export const testvalue = 'test';

I have looked on google and I was unable to personally find anything.

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