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

add types to export in package.json #15

Merged
merged 1 commit into from
Dec 16, 2023
Merged

add types to export in package.json #15

merged 1 commit into from
Dec 16, 2023

Conversation

tw-blue
Copy link
Contributor

@tw-blue tw-blue commented Dec 14, 2023

"types" need to be inside "exports" in newer versions of TypeScript.
Documentation

Otherwise the following error appears

Could not find a declaration file for module 'csrf-sync'. './node_modules/csrf-sync/lib/esm/index.js' implicitly has an 'any' type.
There are types at './node_modules/csrf-sync/lib/index.d.ts', but this result could not be resolved when respecting package.json "exports".
The 'csrf-sync' library may need to update its package.json or typings.

"types" need to be inside "exports" in newer versions of TypeScript

Otherwise the following error appears:
Could not find a declaration file for module 'csrf-sync'. './node_modules/csrf-sync/lib/esm/index.js' implicitly has an 'any' type.
  There are types at './node_modules/csrf-sync/lib/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'csrf-sync' library may need to update its package.json or typings.
@psibean
Copy link
Contributor

psibean commented Dec 16, 2023

Likely we should update csrf-sync here to also have both the .d.ts and .d.cts files as well.

I'll do that and drop a patch release

@psibean psibean merged commit b5083b8 into Psifi-Solutions:main Dec 16, 2023
4 checks passed
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