Skip to content

[60.3] fetch issue [unable to parse json, unexpected token in json at position 1] #25701

Closed
@MasoudAlali

Description

@MasoudAlali

React Native version:
0.60.3

Steps To Reproduce

  1. upgrade react native to 0.60.3 and clean node modules and install it again
  2. send a request with fetch

there will be error like this:
unexpected token o in json at position 1

and I investigated for issue and it happens because in whatwg-fetch library
in line 492 support.blob will be true and the response from xhr will be Blob
so in fetch response.json() will fail because response is Blob not stringified json

there are some hotfixes, but I don't know exact solution for this

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugStaleThere has been a lack of activity on this issue and it may be closed soon.🌐NetworkingRelated to a networking API.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions