We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The conditional exports in package.json points to files which does not exist:
unfetch/package.json
Lines 16 to 20 in ee5810e
This causes the following errors when importing unfetch with typescript:
unfetch
Cannot find module 'unfetch' or its corresponding type declarations.ts(2307)
Also, if you're declaring conditional exports and have type declarations (d.ts) in different location, I think you need to add "types" as the first export condition (see: https://www.typescriptlang.org/docs/handbook/esm-node.html, and microsoft/TypeScript#48235)
Therefore, I believe the correct exports should've been:
"exports": { ".": { "types": "./src/index.d.ts", "import": "./dist/unfetch.mjs", "default": "./dist/unfetch.js" },
FWIW, I'm using Typescript 4.9 with moduleResolution": "NodeNext"
Typescript 4.9
moduleResolution": "NodeNext"
The text was updated successfully, but these errors were encountered:
Sorry, I just realized this might be related to this issue: #162
Sorry, something went wrong.
No branches or pull requests
The conditional exports in package.json points to files which does not exist:
unfetch/package.json
Lines 16 to 20 in ee5810e
This causes the following errors when importing
unfetch
with typescript:Also, if you're declaring conditional exports and have type declarations (d.ts) in different location, I think you need to add "types" as the first export condition (see: https://www.typescriptlang.org/docs/handbook/esm-node.html, and microsoft/TypeScript#48235)
Therefore, I believe the correct exports should've been:
FWIW, I'm using
Typescript 4.9
withmoduleResolution": "NodeNext"
The text was updated successfully, but these errors were encountered: