-
-
Notifications
You must be signed in to change notification settings - Fork 956
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
got 12.4.1 dependency cacheable-request does not transpile #2129
Comments
This is caused by https://github.com/sindresorhus/responselike/releases/tag/v3.0.0 which is breaking for https://github.com/jaredwray/cacheable-request due to removal of |
Yep. Wasted an hour tracking this down. Hardcoded
|
Due to sindresorhus/got#2129 Also pin the `@types/responselike` dependency to 1.0.0. Some transitive deps are pinned to ensure we have somewhat consistent dependencies there...
Still facing error |
Recommendation for everyone to pin "resolutions": {
"@types/responselike": "1.0.0"
}, Unless using frozen lockfile, you WILL fetch stub |
This is currently a known problem with DT: DefinitelyTyped/DefinitelyTyped#62111. You can workaround it by explicitly installing the older versions of the types packages: npm i -D @types/[email protected] @types/[email protected] If you use "overrides": {
"@types/responselike": "1.0.0"
} If you use "resolutions": {
"@types/responselike": "1.0.0"
} Currently, the only way to really provide a fix is for |
Another quick fix idea: include ambient types definitions from declare module 'responselike' {
// copy-paste types from @types/[email protected]
} |
…seLike' as a type. ref: sindresorhus/got#2129
@BendingBender as of npm 8.3.0, I believe you can do the same thing with "overrides". |
Ok, the DTS maintainers now have moved the |
Thank you @BendingBender . If someone in the thread builds successfully with the latest version of got, please post. We won't run a build with an affected library until early next week. If I'm the first to report, I'll close this thread when our build succeeds. |
This will never work, regardless of DTS fixing it. Taking a deeper dive, for TS import ResponseLike = require('responselike'); TypeScript compiler will hence look at
@sindresorhus You claim to support TS and ESM yet your own packages create a dependency conflict
@jaredwray
|
ESM works fine. This is a problem with TS.
npm works how it has always worked. This is a TS deficiency. |
I plan to upgrade |
@sindresorhus Since you're in this thread, I'll take the opportunity to say: I really appreciate everything you've done for the community. A pleasure to interact at last. |
@sindresorhus thanks for all the help on this and we have published Release Notes for v9: https://github.com/jaredwray/cacheable-request/releases/tag/v9.0.0 |
Sorry I have forgot that conflicts with transitive dependencies are properly resolved here. I'll amend my original comment. |
@jaredwray It would be great if the changelog included what it looked like before, not just the new way to call it. Right now it's very hard to see what needs changing. Example: https://github.com/sindresorhus/got/releases/tag/v12.0.0-beta.1 (see the examples with the diff syntax). |
I probably won't be able to get to this for a couple of weeks. I'm traveling and have limited time, and I thought this would be a simple upgrade, but it doesn't seem so. Pull request welcome if anyone wants it to happen sooner. Need to change stuff around: Lines 971 to 1015 in f0ac0b3
|
@jaredwray Also, |
Newer version of 'got' (which is brought in by 'npm-check-updates') depends on an outdated "@types/cacheable-requests" More info: sindresorhus/got#2129
This has been updated with a diff and we will look at how to help on this with a pull request. |
https://github.com/jaredwray/cacheable-request/releases/tag/v10.0.1 |
Due to sindresorhus/got#2129 Also pin the `@types/responselike` dependency to 1.0.0. Some transitive deps are pinned to ensure we have somewhat consistent dependencies there...
We have now updated https://github.com/jaredwray/cacheable-request/releases/tag/v10.0.2 |
@sindresorhus have you plan to port this fix to got@11? |
No |
…2164) Fixes: #2163 The underlying issue (sindresorhus/got#2129) has been resolved and packages are again building correctly with the latest versions of the affected packages. This PR serves as proof of this. --- By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Describe the bug
Running TypeScript 4.8.2:
Many errors generated on build of form
node_modules/@types/cacheable-request/index.d.ts:118:60 - error TS2709: Cannot use namespace 'ResponseLike' as a type.
npm explain latest-version
[email protected] dev
node_modules/cacheable-request
cacheable-request@"^7.0.2" from [email protected]
node_modules/got
got@"^12.1.0" from [email protected]
node_modules/package-json
package-json@"^8.1.0" from [email protected]
node_modules/latest-version
dev latest-version@"^7.0.0" from the root project
Problem remediated with:
and installing with
npm ci
if installing with yarn, use --frozen-lockfile as noted by proton-ab below.
Checklist
The text was updated successfully, but these errors were encountered: