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

SyntaxError Unexpected token u in JSON at position 0 #36

Closed
pauldb09 opened this issue Mar 21, 2022 · 4 comments
Closed

SyntaxError Unexpected token u in JSON at position 0 #36

pauldb09 opened this issue Mar 21, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@pauldb09
Copy link

image

Environment

Node v16

@pauldb09 pauldb09 added the bug Something isn't working label Mar 21, 2022
@tbnritzdoge
Copy link
Member

It appears that you are attempting to parse JSON from a response that isn't JSON so this isn't a library issue.

@sinkaroid
Copy link

In my case basically the JSON was valid, but it's messy on some version of node. Broke on 16.17.0 but not in 16.16.0 when using petitio

@dzlandis
Copy link

dzlandis commented Nov 8, 2022

In my case basically the JSON was valid, but it's messy on some version of node. Broke on 16.17.0 but not in 16.16.0 when using petitio

Experienced this same issue when trying to use petitio in Node version v16.18 when the JSON was valid. Was fixed by downgrading to v16.16.0 as the comment above mentions. Please fix and reopen this issue!

@DJCoolDev
Copy link

I can confirm this. A downgrade as mentioned above fixed the problem for me. However, it would be nice if it would also work in newer versions.

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

No branches or pull requests

5 participants