-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Labels
priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
Please make sure you have searched for information in the following guides.
- Search the issues already opened: https://github.com/googleapis/google-cloud-node-core/issues
- Search StackOverflow: http://stackoverflow.com/questions/tagged/google-cloud-platform+node.js
- Check our Troubleshooting guide: https://github.com/googleapis/google-cloud-node-core/blob/main/docs/troubleshooting.md
- Check our FAQ: https://github.com/googleapis/google-cloud-node-core/blob/main/docs/faq.md
- Check our libraries HOW-TO: https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md
- Check out our authentication guide: https://github.com/googleapis/google-auth-library-nodejs
- Check out handwritten samples for many of our APIs: https://github.com/GoogleCloudPlatform/nodejs-docs-samples
- Check the API's issue tracker: https://cloud.google.com/support/docs/issue-trackers
Link to the code that reproduces this issue. A link to a public Github Repository or gist with a minimal reproduction.
https://github.com/chrispisano-bc/bare-bones-bazel
A step-by-step description of how to reproduce the issue, based on the linked reproduction.
Environment details
- OS: macOS 15.7.4 (24G517)
- Bazel with aspect_rules_ts 2.4.2
- aspect_rules_ts 3.6.3 (TypeScript project)
- Node/npm: 22.11.0
- pnpm 9.14.2
Steps to reproduce
- Clone this repo: https://github.com/chrispisano-bc/bare-bones-bazel
- read
REPRODUCE.MD - Observe that the type checker cannot resolve undici-types:
error TS2307: Cannot find module 'undici-types' or its corresponding type declarations. - Observe that if you install
undici-typesas a direct dependency or flipskipLibChecktotrue, then thereproduce.jsscript no longer throws.
A clear and concise description of what the bug is, and what you expected to happen.
Description
undici-types is not declared as a direct/optional dependency in gaxios’s package.json, but the published type declarations use it. In packages/gaxios/src/common.ts (and in the emitted build/cjs/src/common.d.ts), the type is defined as:
type _BodyInit = typeof globalThis extends {BodyInit: infer T}
? T
: import('undici-types').BodyInit;
In an isolated build environment (Bazel), this breaks the build if the associated tsconfig file has set skipLibCheck: false
Expected Result
Type-checking succeeds in isolated build environments. Gaxios should either declare undici-types as an optional/direct dependency or the published types should not reference it.
A clear and concise description WHY you expect this behavior, i.e., was it a recent change, there is documentation that points to this behavior, etc. **
I expect library types to compile even when skipLibCheck is set to false
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.