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

Fix importing types on Node 16 module resolution #424

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

JavaScriptBach
Copy link

Fixes #332

I upgraded my TypeScript moduleResolution to Node 16, and TypeScript stopped being able to find the types. This change should fix it.

@srenatus
Copy link
Contributor

Thanks a lot! Could you squash and sign-off, please, so we can get this merged? Details here

Signed-off-by: Phillip Huang <[email protected]>
Signed-off-by: Phillip Huang <[email protected]>
Comment on lines +45 to +46
mv $outdir/types/opa.d.ts $outdir/types/opa.d.mts
cp $outdir/types/opa.d.mts $outdir/types/opa.d.cts
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately separate declaration files are required. Otherwise, typescript will assume the types are either ESM or CJS depending on the value of the type field of the nearest package.json.

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 this pull request may close these issues.

It appears that opa.d.ts is missing
2 participants