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

Error in ok handler #233

Open
dinfyru opened this issue Oct 15, 2019 · 1 comment
Open

Error in ok handler #233

dinfyru opened this issue Oct 15, 2019 · 1 comment

Comments

@dinfyru
Copy link

dinfyru commented Oct 15, 2019

I have error when try to use ok handler. redux-api-middleware - 3.0.1

      ok: async res => {
        const json = await res.json();
        return res.ok && !json.error;
      },

Error

payload: 
message: "Failed to execute 'json' on 'Response': body stream is locked"
name: "InternalError"
@iamandrewluca
Copy link
Collaborator

iamandrewluca commented Dec 16, 2019

@dinfyru try this one

ok: async res => {
                     /* vvvvvvvv */
  const json = await res.clone().json();
  return res.ok && !json.error;
},

Related #218

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

2 participants