openapi-typescript
openapi-typescript copied to clipboard
Cannot find name 'HeadersInit'.
Description
node_modules/.pnpm/[email protected]/node_modules/openapi-fetch/dist/index.d.ts:27:5 - error TS2304: Cannot find name 'HeadersInit'.
27 | HeadersInit
~~~~~~~~~~~
Found 1 error in node_modules/.pnpm/[email protected]/node_modules/openapi-fetch/dist/index.d.ts:27
ELIFECYCLE Command failed with exit code 1.
node:internal/modules/cjs/loader:1215
throw err;
^
Reproduction
You can just write the code that simply request path using openapi-fetch, and try compile it using tsc to reproduction.
Expected result
Build successfully w/o any exceptions
Checklist
- [ ] I’m willing to open a PR (see CONTRIBUTING.md)
Description
node_modules/.pnpm/[email protected]/node_modules/openapi-fetch/dist/index.d.ts:27:5 - error TS2304: Cannot find name 'HeadersInit'. 27 | HeadersInit ~~~~~~~~~~~ Found 1 error in node_modules/.pnpm/[email protected]/node_modules/openapi-fetch/dist/index.d.ts:27 ELIFECYCLE Command failed with exit code 1. node:internal/modules/cjs/loader:1215 throw err; ^Reproduction
You can just write the code that simply request path using openapi-fetch, and try compile it using tsc to reproduction.Expected result
Build successfully w/o any exceptionsChecklist
- [ ] I’m willing to open a PR (see CONTRIBUTING.md)
I wrote a case, but this did not happen, can you provide a detailed case of repetition? And your version of node,typescript... Also, HeadersInit is built-in, and I'm guessing there are some issues with your typescript configuration
Description
node_modules/.pnpm/[email protected]/node_modules/openapi-fetch/dist/index.d.ts:27:5 - error TS2304: Cannot find name 'HeadersInit'. 27 | HeadersInit ~~~~~~~~~~~ Found 1 error in node_modules/.pnpm/[email protected]/node_modules/openapi-fetch/dist/index.d.ts:27 ELIFECYCLE Command failed with exit code 1. node:internal/modules/cjs/loader:1215 throw err; ^Reproduction
You can just write the code that simply request path using openapi-fetch, and try compile it using tsc to reproduction.Expected result
Build successfully w/o any exceptionsChecklist
- [ ] I’m willing to open a PR (see CONTRIBUTING.md)
I wrote a case, but this did not happen, can you provide a detailed case of repetition? And your version of node,typescript... Also, HeadersInit is built-in, and I'm guessing there are some issues with your typescript configuration
node: 22.3.0. "@types/node": "20.12.7", "typescript": "^5.4.3"
I used gts to initialize tsconfig.json, so you may also want to refer gts version: "gts": "^5.3.1",
just-for-test.zip This is simple reproduction for this issue. You may need to install [email protected] w/ corepack to check this reproduction.
+1
Any updates on this? I'm having the same issue.
The only thing I've found to avoid this build issue is by including skipLibCheck: true in the tsconfig.
Fixed in [email protected]