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

466
Views
Error [ERR_REQUIRE_ESM]: require () del módulo ES no compatible: URL de archivo

Me sale este extraño error:

 Error [ERR_REQUIRE_ESM]: require() of ES Module /home/raphy/Raphy-Template/node_modules/file-url/index.js from /home/raphy/Raphy-Template/dist/src/main/main.js not supported. Instead change the require of index.js in /home/raphy/Raphy-Template/dist/src/main/main.js to a dynamic import() which is available in all CommonJS modules

Y no entiendo por qué sucede esto:

node: v16.15.0 , typescript": "^4.5.4 , OS: Ubuntu 20.04 Desktop

Este es tsconfig.json :

 { "compilerOptions": { "typeRoots": ["./node_modules/@types"], "target": "es2021", "module": "commonjs", "lib": ["es2021"], "outDir": "dist", //"jsx": "react", "jsx": "react-jsx", "baseUrl": "./src", "paths": { "@sections/*": ["app/sections/*"], "@app/*": ["app/*"] }, "strict": true, "sourceMap": true, "skipLibCheck": true, "noImplicitAny": false, "noImplicitThis": false, "moduleResolution": "node", "esModuleInterop": true, "experimentalDecorators": true, "allowSyntheticDefaultImports": true, "resolveJsonModule": true, "allowJs": true }, "include": ["src/**/*"], "exclude": [ "src/index.js", "dist", ] }

Y en main.ts importo file-url de esta manera:

 import fileUrl from 'file-url'

Donde ya estoy importando muchos otros paquetes de la misma manera sin ningún problema: Por ejemplo: import validUrl from 'valid-url'; no da ningun error

Pero en el archivo compilado /dist/src/main.js : veo:

 const file_url_1 = __importDefault(require("file-url"));

¿Como resolver el problema?

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!