long.js
long.js copied to clipboard
Issue when running build on a NodeJS app
Receiving the following error when running "npm run build" on a TypeScript NodeJS app:
node_modules/long/umd/index.d.ts:1:18 - error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("../index.js")' call instead.
1 import Long from "../index.js";
Following the error logs, it all comes to this package. I'm not sure which one of my packages uses "long"
currently having the exact same issue. Related to https://github.com/dcodeIO/long.js/issues/125
Having same issue, anyone find the solution ? Thanks
I am facing the same issue
The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("../index.js")' call instead.
it is being used by pnpm but I am not sure what's wrong
@dcodeIO Is there any resolution in sight for this? The problem is inproper TypeScript types for long when using ESM.