DefinitelyTyped / DefinitelyTyped/DefinitelyTyped

RequestInit - Type '"timeout"' is not assignable to type 'keyof RequestInit'

Open
#59,314 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
51.4k
Forks
30.4k
Avg merge
3d 21h
Merged PRs (30d)
108

Description

@types/node-fetch version: v2.6.1
RequestInit is found in: node_modules/node-fetch/@types/index.d.ts

@types/make-fetch-happen: v9.0.2
node_modules/@types/make-fetch-happen/index.d.ts:25:9

Full Error:

node_modules/@types/make-fetch-happen/index.d.ts:25:9 - error TS2344: Type '"timeout" | "headers" | "agent" | "method" | "body" | "size" | "follow" | "redirect" | "compress"' does not satisfy the constraint 'keyof RequestInit'.
  Type '"timeout"' is not assignable to type 'keyof RequestInit'.

25         'method' | 'body' | 'redirect' | 'follow' | 'timeout' | 'compress' | 'size' | 'headers' | 'agent'
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Inspect node_modules/@types/make-fetch-happen/index.d.ts and node_modules/node-fetch/@types/index.d.ts to compare the RequestInit keys involved. Reproduce the TypeScript error and verify that the incompatible keyof RequestInit constraint is resolved without the reported TS2344 error.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.