Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

232
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda