Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue when running build on a NodeJS app #131

Open
VeniMitev opened this issue Nov 28, 2023 · 5 comments · May be fixed by #133
Open

Issue when running build on a NodeJS app #131

VeniMitev opened this issue Nov 28, 2023 · 5 comments · May be fixed by #133

Comments

@VeniMitev
Copy link

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"

@japrescott
Copy link

japrescott commented Dec 4, 2023

currently having the exact same issue. Related to #125

@vivekjpatel
Copy link

Having same issue, anyone find the solution ? Thanks

@localhostd3veloper
Copy link

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

@philkunz
Copy link

philkunz commented Jun 17, 2024

@dcodeIO Is there any resolution in sight for this? The problem is inproper TypeScript types for long when using ESM.

bobcyw added a commit to bobcyw/long.js that referenced this issue Jul 2, 2024
@bobcyw bobcyw linked a pull request Jul 2, 2024 that will close this issue
@Sam-Spencer
Copy link

@dcodeIO Bump! Any update on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants