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

Cannot find module 'undici-types' or its corresponding type declarations #562

Closed
everdimension opened this issue Feb 29, 2024 · 0 comments
Closed

Comments

@everdimension
Copy link

I updated from 0.33 to 1.2.1 and seeing this error when bundling my project:

Cannot find module 'undici-types' or its corresponding type declarations.

1 import { type RequestInit as UndiciRequestInit } from 'undici-types';

I see that this dependency is indeed referenced in source code:

import {type RequestInit as UndiciRequestInit} from 'undici-types';

But at the same time it's not present in package dependencies:

ky/package.json

Lines 56 to 76 in 58b5c4a

"devDependencies": {
"@sindresorhus/tsconfig": "^4.0.0",
"@type-challenges/utils": "^0.1.1",
"@types/body-parser": "^1.19.2",
"@types/busboy": "^1.5.0",
"@types/express": "^4.17.17",
"@types/node": "^20.5.7",
"ava": "^5.3.1",
"body-parser": "^1.20.2",
"busboy": "^1.6.0",
"del-cli": "^5.1.0",
"delay": "^6.0.0",
"expect-type": "^0.16.0",
"express": "^4.18.2",
"pify": "^6.1.0",
"playwright": "^1.40.1",
"raw-body": "^2.5.2",
"tsx": "^4.7.0",
"typescript": "^5.2.2",
"xo": "^0.56.0"
},

Why is there a dependency on a third-party package in source code?
If it is necessary, ideally it should be bundled into the build so that consumer packages do not need to install a third-party dependency only for types.

Alternatively, if this is the only usage of this type, maybe it can be inlined into the source code?

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

No branches or pull requests

1 participant