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

327
Views
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
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!