openapi-ts / openapi-typescript

Generate TypeScript types from OpenAPI 3 specs
https://openapi-ts.dev
MIT License
5.02k stars 404 forks source link

Cannot find name 'HeadersInit'. #1735

Open kms0219kms opened 1 week ago

kms0219kms commented 1 week ago

Description

node_modules/.pnpm/openapi-fetch@0.10.2/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/openapi-fetch@0.10.2/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

phk422 commented 1 week ago

Description

node_modules/.pnpm/openapi-fetch@0.10.2/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/openapi-fetch@0.10.2/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 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

kms0219kms commented 4 days ago

Description

node_modules/.pnpm/openapi-fetch@0.10.2/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/openapi-fetch@0.10.2/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 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",

kms0219kms commented 4 days ago

just-for-test.zip This is simple reproduction for this issue. You may need to install pnpm@9.4.0 w/ corepack to check this reproduction.