Skip to content

Cannot find name 'HeadersInit'. #1735

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task
kms0219kms opened this issue Jun 26, 2024 · 6 comments · Fixed by #1827
Closed
1 task

Cannot find name 'HeadersInit'. #1735

kms0219kms opened this issue Jun 26, 2024 · 6 comments · Fixed by #1827
Labels
bug Something isn't working openapi-fetch Relevant to the openapi-fetch library

Comments

@kms0219kms
Copy link

kms0219kms commented Jun 26, 2024

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 kms0219kms added bug Something isn't working openapi-fetch Relevant to the openapi-fetch library labels Jun 26, 2024
@phk422
Copy link
Contributor

phk422 commented Jun 27, 2024

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

@kms0219kms
Copy link
Author

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
Copy link
Author

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

@edonv
Copy link

edonv commented Jul 6, 2024

+1

@edonv
Copy link

edonv commented Jul 29, 2024

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.

@ngraef
Copy link
Contributor

ngraef commented Aug 7, 2024

Fixed in [email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working openapi-fetch Relevant to the openapi-fetch library
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants