openapi-typescript icon indicating copy to clipboard operation
openapi-typescript copied to clipboard

Cannot find name 'HeadersInit'.

Open kms0219kms opened this issue 1 year ago • 4 comments

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

kms0219kms avatar Jun 26 '24 14:06 kms0219kms

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 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

phk422 avatar Jun 27 '24 06:06 phk422

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 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 avatar Jul 01 '24 16:07 kms0219kms

just-for-test.zip This is simple reproduction for this issue. You may need to install [email protected] w/ corepack to check this reproduction.

kms0219kms avatar Jul 01 '24 16:07 kms0219kms

+1

edonv avatar Jul 06 '24 02:07 edonv

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.

edonv avatar Jul 29 '24 18:07 edonv

Fixed in [email protected]

ngraef avatar Aug 07 '24 20:08 ngraef