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 README.md about TypeScript support & UMD bundle #1843

Open
Strift opened this issue Jan 29, 2025 · 2 comments
Open

Update README.md about TypeScript support & UMD bundle #1843

Strift opened this issue Jan 29, 2025 · 2 comments
Labels
documentation Improvements or additions to documentation

Comments

@Strift
Copy link
Collaborator

Strift commented Jan 29, 2025

Add mention about TypeScript support

Hey @bramses!

What version of TypeScript do you have? How does your tsconfig.json look like?

Your Node.js version is fine, we do only support Node.js versions that support the "exports" field (v14.13.0, v12.20.0), but officially we only test and support Maintenance and LTS versions of Node.js (so no End Of Life versions). (https://github.com/nodejs/Release?tab=readme-ov-file#release-schedule)

For TypeScript support (>=4.7) read more here: https://www.typescriptlang.org/docs/handbook/modules/reference.html#packagejson-exports
When moduleResolution is set to node16, nodenext, or bundler, and resolvePackageJsonExports is not disabled, TypeScript follows Node.js’s package.json "exports" spec when resolving from a package directory triggered by a bare specifier node_modules package lookup.

You probably need to set moduleResolution to node16, nodenext, or bundler.

If you don't want to read up about what to choose, just take a look at https://github.com/tsconfig/bases?tab=readme-ov-file#node-20-tsconfigjson
Or directly at the config: https://github.com/tsconfig/bases/blob/main/bases/node20.json

Take a look at this comment: #1690 (comment)

Originally posted by @flevi29 in #1838

Add mention about UMD bundle

As seen originally in #1836

Additionally

Any configuration/requirement changes for end users related to #1740

@Strift Strift added the documentation Improvements or additions to documentation label Jan 29, 2025
@flevi29
Copy link
Collaborator

flevi29 commented Jan 29, 2025

I believe it is still possible to import token on older Node.js versions. Will leave a note about later.

@Strift Strift mentioned this issue Jan 29, 2025
3 tasks
@Strift Strift changed the title Update README.md about TypeScript support Update README.md about TypeScript support & UMD bundle Jan 29, 2025
@Strift
Copy link
Collaborator Author

Strift commented Jan 29, 2025

Also update this issue to track the note about UMD 👌

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

No branches or pull requests

2 participants