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

Getting error: res.headers.raw is not a function #42

Closed
M-Nasab opened this issue Dec 30, 2019 · 3 comments
Closed

Getting error: res.headers.raw is not a function #42

M-Nasab opened this issue Dec 30, 2019 · 3 comments

Comments

@M-Nasab
Copy link

M-Nasab commented Dec 30, 2019

I get this error when i use this library:

Uncaught (in promise) TypeError: res.headers.raw is not a function at fetchCookie (index.js?a60e:41)
@fabiante
Copy link
Collaborator

fabiante commented Jan 2, 2020

This could happen because fetch-cookie assumes you use node-fetch v2 and may fail if you aren't:

fetch-cookie/index.js

Lines 40 to 41 in 4fcbe62

// node-fetch v2
const headers = res.headers.raw()

What fetch implementation are you using in what environment?

@greggilbert
Copy link

FWIW I've got this happening right now, using node-fetch 2.6.1. Replicated in both Firefox and Safari.

@valeriangalliat
Copy link
Owner

Hey! I just published v2.0.0 with improved support for various fetch implementations!

headers.raw was pretty specific to node-fetch but now fetch-cookie also supports any fetch implementation compatible with the WHATWG Fetch standard API (as long as it exposes the set-cookie header)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants