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: missing types entry in package exports #42

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jcwillox
Copy link

Typescript complains it can't find the types when using ESM, so I updated the exports config to include types and it stopped complaining 👍. With this change type checking and bundling now works in ESM projects (or I guess newer node versions/typescript versions that support exports).

@ybiquitous
Copy link

Hi @jcwillox, this PR seems to duplicate with #28 :)

@jcwillox
Copy link
Author

Oh yeah it is, didn't see that before 👀, the other one is probably more correct with the cts and mts types, although the combined one works too.

Copy link

@typed-sigterm typed-sigterm left a comment

Choose a reason for hiding this comment

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

The missing types does indeed cause errors in VS Code.

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

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.

3 participants