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

329
Vistas
node: getting error importing CommonJS module however I try to import it

I have a local node module, @em/inVis in my company whose index.d.ts file looks as follows:

import UWeb from "./UWeb";
import UWebParams from "./UWebParams";
export { UWeb, UWebParams };

elsewhere within the app, it's used as follows in typescript files

import { UWeb, UWebParams } from "@em/inVis";

when I try to do that in my TS file, I get the node error:

SyntaxError: Named export 'UWeb' not found. The requested module '@em/inVis' is a CommonJS module, which may not support all module.exports as named exports. CommonJS modules can always be imported via the default export, for example using:

import pkg from '@em/inVis'; const { UWeb, UWebParams } = pkg;

so when I try using that approach suggested above, I am getting the node error:

SyntaxError: Cannot use import statement outside a module not sure what I am doing wrong.

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