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

Export types from package.json #6

Merged
merged 1 commit into from
Mar 5, 2024

Conversation

boylett
Copy link
Contributor

@boylett boylett commented Feb 13, 2024

See TypeScript #52363 for further information

Importing mergician without types exported results in the following error when TypeScript moduleResolution config is set to Bundler:


There are types at '/node_modules/mergician/dist/mergician.d.ts', but this result could not be resolved when respecting package.json "exports". The 'mergician' library may need to update its package.json or typings.```

See [TypeScript #52363](microsoft/TypeScript#52363) for further information

Importing mergician without types exported results in the following error when TypeScript `moduleResolution` config is set to `Bundler`:
`Could not find a declaration file for module 'mergician'. '/node_modules/mergician/dist/mergician.esm.js' implicitly has an 'any' type.
  There are types at '/node_modules/mergician/dist/mergician.d.ts', but this result could not be resolved when respecting package.json "exports". The 'mergician' library may need to update its package.json or typings.`
Copy link
Owner

@jhildenbiddle jhildenbiddle left a comment

Choose a reason for hiding this comment

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

Thanks for this, @boylett.

If we add export.types I assume we can remove the top-level types property found above the exports property?

@boylett
Copy link
Contributor Author

boylett commented Feb 13, 2024

To ensure minimal breakage, I'd leave the top-level type where it is just in case. You never know, someone somewhere may be using it for something!

@jhildenbiddle jhildenbiddle merged commit 71da6e6 into jhildenbiddle:main Mar 5, 2024
4 checks passed
@jhildenbiddle
Copy link
Owner

Thanks, @boylett!

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.

None yet

2 participants