-
-
Notifications
You must be signed in to change notification settings - Fork 522
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
Uncaught (in promise) undefined #572
Comments
I'm also seeing this issue, don't quite understand what is causing it |
note: only seems to happen when using the apollo object in the component options: This code throws the 'uncaught (in promise) undefined' error as the query is hitting a private query:
where as the non smart query version does not - this throws just once as expected and not with the uncaught promise undefined error:
|
I'm having similar problem. Uncaught promise rejection or exception can be handled in vue global errorHandler, if error was thrown from lifecycle hook, but there's no way to create global handler for vue-apollo smart query. This is a little bit frustrating and adding some headache while handling errors. One of solutions is simply not to use smart queries, but would be great to have some global hook for vue-apollo. |
@Akryum I believe we're using the appropriate constructor, it seems any error thrown in the global error handler for errorHandler of the VueApollo will result in this uncaught promise, regardless of whether the error is captured or not. |
@Akryum for example, here is my constructor, all the unauthorized error gets caught and handled appropriately, but I always get this extra uncaught promise error- the error handler kicks in but it always results in a 2nd error and I can't escape it:
|
So I had a look at the code, and this promise seems to cause the error: When my auth-error occurs, For testing purposes I just replaced I'm still not quite sure where this rejection error is coming from, but I also don't know what this promise is supposed to do in the first place. Git-blame suggests it's SSR related (d88e6ac by @Akryum). |
Any updates on this? |
Possibly a similar problem here. In the error() hook, not only is the |
still seeing it in 3.0.0-beta.29, but still unclear with no insights, I'm working around my problems by skipping the offending queries until the loading conditions are valid but under normal circumstances I wouldn't expect that extra undefined error. |
I think I got exactly the same trouble that the others have described. Any of my error handlers would work fine, but additionally that weird However, I managed to get half-way out of this trouble, but instead discovered another disappointment. When I'm putting the |
ya still no joy, curious if there is any official position on this issue |
+1 This is a big issue in my Nuxt application. I'm trying to appropriately handle errors, but I can't chain a Here's what I receive when I try to chain a
|
Your first issue may be able to be solved by deconstructing the error: Your second issue may be related to the scoping of the method. Try: |
Thanks a lot @Akryum ✌️ |
thanks much @Akryum |
Thanks a lot for fixing it, @Akryum ! |
Hi there!
I'm authenticating requests via cookies. If a user is not logged in, the server responds with this error message:
Now, of course I want to catch this error in my Vue-Component:
But for some reason this error always shows up in my console, saying that there is an uncatched Promise:
I already had a look around here at related issues, especially #519 and #265. Sadly, I can't really pinpoint where this error even comes from, because Chrome and Firefox show me completely different stacktraces, not even pointing to the error. At least Chrome said the error is from somewhere inside
vue-apollo.esm.js
, so here I am now.I created the project with the Vue-Cli and didn't change much of the original config, so I'm thinking this might be a bug?
The text was updated successfully, but these errors were encountered: