apollo-client-devtools: Uncaught DOMException: Failed to execute 'postMessage' on 'Window' #1879
From AC
- could be related to #1871
I have afterware on my apollo client to handle errors in my app. In order to check the server’s response status I have to clone the response. It was working fine until suddenly (chrome update?) I started getting this message:
DOMException: Failed to execute 'postMessage' on 'Window': Error: Network request failed with status 401 - "Unauthorized" could not be cloned.
(the error is the response from the server).
To replicate, create an afterware that clones the response from the server.
Thanks!
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 16
- Comments: 21 (12 by maintainers)
Commits related to this issue
- Merge pull request #91 from pSchaub/patch-1 Fix #75 #64 #58 — committed to apollographql/apollo-client-devtools by deleted user 6 years ago
Guys, I found a solution! Disable Apollo-client-devtools and viola, no more junk spewed into the console…haha. But seriously, hugely annoying bug – I’m disabling it until this is fixed.
@barbalex but then I couldn’t get nice messages like yours
@ramyanaga This is causing a fatal issue in my app whenever we get an error from our GraphQL server (An error where the HTTP response code is 200, but the response contains an
errors
property). As far as I can tell, the root of the issue is that ApolloClient dispatches 1 an instance ofError
(sinceApolloError extends Error
2) to Redux.Error
objects are not able to be sent viawindow.postMessage
3. I don’t believe there is anything I can do on the app side to prevent or solve this other than to not use the Apollo DevTools.Hey guys, I am also experiencing this issue when sending encoded json as a string.
Request payload:
Relevant types:
Error Messages:
The “JSON” field are stringified before so AFAIK this should not have any custom behaviour. I will try to set up a reproduction repo.
@tnrich yep that’s the line in particular. I’ll try adding that line to give better error messages, but ideally I’d just stringify and unstringify the object within the app. Also, are you running the most recent version of the devtools (2.0.2)? I created a test app that uses response.clone() in afterware, but I don’t seem to be having a problem
Are you trying to post objects that are not Json-serializable? If so, this is the same issue as #58