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: add exports.types field #120

Merged
merged 1 commit into from
Apr 10, 2023
Merged

fix: add exports.types field #120

merged 1 commit into from
Apr 10, 2023

Conversation

bounoable
Copy link
Contributor

Fixes the following TypeScript error when moduleResolution is set to "nodenext" or "bundler":

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

See https://nodejs.org/api/packages.html#community-conditions-definitions

Fixes the following TypeScript error when `moduleResolution` is set to `"nodenext"` or `"bundler"`:

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

See https://nodejs.org/api/packages.html#community-conditions-definitions
@pi0 pi0 merged commit 2737559 into unjs:main Apr 10, 2023
@bounoable bounoable deleted the patch-1 branch April 10, 2023 23:47
aa900031 added a commit to aa900031/pkg-types that referenced this pull request May 9, 2023
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