-
Notifications
You must be signed in to change notification settings - Fork 17
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
Invalid type definitions - static import of ESM types from CJS types #447
Comments
Thanks for reporting this! It's good to know there's a workaround, i'll add it to our internal triage. |
I'm a bit surprised about TypeScript emitting this error for a |
They're not using |
We're only importing https://github.com/netlify/functions/blob/main/src/function/v2.ts#L1 So I don't think that an actual import line shows up in the generated JS file. This seems to be purely about the declaration file that TypeScript generates, and I would have expected TypeScript to generate it in a way that's compliant with CJS, because that's how it's configured: Line 27 in 7552375
Anyways, distributing this as ESM makes sense to me. @eduardoboucas do you see any reason why this might become a problem? Maybe consumption from within Next.js sites? |
I think this will be fixed by #473 |
Describe the bug
Configuration
Import the library in a project which has the following in the
tsconfig.json
:This issue can be worked around with
"skipLibCheck": true
, so ensure that is not set when reproducing. It is not set by default.The text was updated successfully, but these errors were encountered: