Summary
A clean install on current main fails to build because createCertAwareFetch() is declared as returning typeof fetch, while the returned async function does not include the static preconnect member now present in current Node typings.
Environment
- OS: macOS
- Node.js version: v22.23.1 (supported by the project's
>=18 engine range)
- Package manager: npm 10.9.8
- Lockfile type: package-lock.json
- CVE Lite CLI version: current
main, commit 5d91e5e83796e80fcaa328706c3e1b9565b43037
@types/node: 24.12.0 resolved by npm ci
Command used
Expected behavior
A clean install on a supported Node version should type-check and allow the test suite to start. The injected fetch contract should describe the callable request behavior used by the scanner, without requiring unrelated static members from a particular Node typing release.
Actual behavior
src/utils/network.ts(187,3): error TS2741: Property 'preconnect' is missing in type '(input: RequestInfo | URL, init?: RequestInit) => Promise<Response>' but required in type 'typeof fetch'.
npm test -- --runInBand fails for the same reason because the E2E global setup runs the build.
Reproduction
- Clone current
main.
- Run
npm ci.
- Run
npm run build.
- Observe TS2741 before any build artifacts are produced.
Relevant files or output
The mismatch is at src/utils/network.ts:174-187. No matching issue or open PR was found.
Proposed scope
Introduce a focused callable fetch type, use it for the cert-aware wrapper and production injection points, and add regression coverage. No runtime scan behavior should change.
I reproduced this on current main and can submit a focused fix.
Summary
A clean install on current
mainfails to build becausecreateCertAwareFetch()is declared as returningtypeof fetch, while the returned async function does not include the staticpreconnectmember now present in current Node typings.Environment
>=18engine range)main, commit5d91e5e83796e80fcaa328706c3e1b9565b43037@types/node: 24.12.0 resolved bynpm ciCommand used
Expected behavior
A clean install on a supported Node version should type-check and allow the test suite to start. The injected fetch contract should describe the callable request behavior used by the scanner, without requiring unrelated static members from a particular Node typing release.
Actual behavior
npm test -- --runInBandfails for the same reason because the E2E global setup runs the build.Reproduction
main.npm ci.npm run build.Relevant files or output
The mismatch is at
src/utils/network.ts:174-187. No matching issue or open PR was found.Proposed scope
Introduce a focused callable fetch type, use it for the cert-aware wrapper and production injection points, and add regression coverage. No runtime scan behavior should change.
I reproduced this on current
mainand can submit a focused fix.