Skip to content
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

Typescript Cannot add any headers to a fetch api #73

Closed
asmanp2012 opened this issue Mar 10, 2022 · 4 comments · Fixed by #77
Closed

Typescript Cannot add any headers to a fetch api #73

asmanp2012 opened this issue Mar 10, 2022 · 4 comments · Fixed by #77

Comments

@asmanp2012
Copy link
Contributor

Package(s)

fetch

Description

The fetch header type has an error.

reproduction link

No response

Please provide the exception or error you saw (Preferably with a screenshot)

Types of property 'headers' are incompatible.
    Type '{ 'Content-Type': string; }' is not assignable to type 'Headers | string[][]'.

Device or platform

Device: Desktop or Phone
OS: windows
Browser: Chrome
Version: 0

Vatr registered list

[
  {
    "name": "@vatr/fetch",
    "vertion": "1.2.3"
  }
]

Anything else?

No response

@asmanp2012 asmanp2012 added the bug label Mar 10, 2022
@alimd
Copy link
Member

alimd commented Mar 10, 2022

Currect way to solve

options.headers = {
  ...options.headers,
  'Content-Type': 'application/json',
};

@MM25Zamanian
Copy link
Contributor

What is fix commit message ??
and What is add me to contributors ?? @alimd

alimd added a commit that referenced this issue Mar 10, 2022
@alimd
Copy link
Member

alimd commented Mar 10, 2022

fix(fetch): build issue #73

chore(packgae): update contributors

@github-actions
Copy link

Issue closed and locked due to lack of activity.
If you encounter this same issue, please open a new issue and refer to this closed one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants