-
-
Notifications
You must be signed in to change notification settings - Fork 81
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
Unhandled Errors with Query SSR (Next.js) #271
Comments
Looks like this issue is being caused by __pushPromise on |
Lines 117 to 124 in 926d8a7
im not sure of the right solution but i have patched mine to add a catch block for this promise that looks like so promise = promise.then((data: any) => {
// cache query and response
if (this.fetchPolicy !== "no-cache") {
this.store.__cacheResponse(this.queryKey, this.store.deflate(data))
}
return this.store.merge(data)
- })
+ }).catch((error) => {
+ this.loading = false
+ this.error = error
+ })
this.promise = promise let me know if this solves your issue. |
@odjhey that doesn't have any impact |
Hi @apjoseph Im trying to help clean up all the open issues.. Did you still have this problem? |
It looks like
GraphQLClient
is leaving server errors unhandled instead of passing them to the query result:This can be reproduced easily by simply running the 5-nextjs example from this repo with the Apollo server middleware in index.js commented out. The 404 error is left unhandled instead of being displayed as text in the component.
The text was updated successfully, but these errors were encountered: