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

Update package.json to support later versions of TypeScript #159

Merged
merged 1 commit into from
Nov 16, 2022
Merged

Update package.json to support later versions of TypeScript #159

merged 1 commit into from
Nov 16, 2022

Conversation

leonsilicon
Copy link
Contributor

@leonsilicon leonsilicon commented Nov 16, 2022

Currently, when using js-base64 with ESM and Node16 "moduleResolution" in TypeScript, TypeScript is unable to resolve the types because it resolves base64.mjs in ESM mode and checks for a definition file named base64.d.mts, which doesn't exist.

I fixed this by adding an explicit "types" property that points to base64.d.ts inside the "exports" property, based on the screenshot of the docs below (screenshot from https://www.typescriptlang.org/docs/handbook/esm-node.html):
image

@dankogai dankogai merged commit 2410b88 into dankogai:main Nov 16, 2022
@dankogai
Copy link
Owner

Thank you!

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.

2 participants