-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Angular 1.6 - Possibly unhandled rejection: canceled #5890
Comments
angular 1.6 is currently not supported by UI-Grid, but thank you for the information |
+1 |
This is a result of timeout.cancel (about 8 times in code). UI-Grid creates own promise with .then(), right after defining the cancel. This is the main offender, but there are others:
simple change to the then part to
|
For anyone that wants a workaround (not recommended, though), you can globally silence unhandled promise rejections like this —
|
sebastian-zarzycki-es solution prevents the "Possibly unhandled rejection: canceled" error but the offending code should be rewritten to prevent hiding possible errors. |
Can $timeout.cancel ever throw an error? |
+1 |
+1 |
not sure about that sebastian but angular 1.6.0 conforms to promises/a+ so proper handling should look like you suggested $promise.then(() => {},angular.noop) or $promise.then().catch() else we get the "Possibly unhandled rejection: canceled", notice you should prefer the latter as 1.6.0 migration suggest... https://docs.angularjs.org/guide/migration#migrate1.5to1.6-ng-services-$http |
Yes, I agree. All I'm saying is that the error response will probably never trigger anyway in this case, so angular.noop will do just fine. But, yeah, using proper then().catch() is better, even if catch would be empty. |
+1 |
I tried using the Is there a way to have the one module use a sort of "separate |
@sebastian-zarzycki-es Could you point out where in the code you found that block? I might have to tackle this myself |
Just search for $timeout.cancel and look for any .then() connected to them in near, as they create new promise, that has to handle the error part with catch. |
+1 support angular 1.6 |
using sebastian-zarzycki-es solution i have added ".catch(angular.noop)" to all the offending promises on the latest 4.0.2 uigrid for angular 1.6.1... all features are working for my implementation and not getting the Possibly unhandled rejection: canceled... |
@dominusbelial Do you happen to have your fix on a GitHub repo? |
We are willing to accepts pull requests for this fix |
in branch i fixed this trouble |
@cybermerlin I just tested out the window.setTimeout from your branch and the problem still remains when I click on a column header to sort by column. |
forked and updated in my branch |
@dominusbelial Put in a PR? 😄 |
@mattbrunetti will do, this is my first time! |
+1 |
2 similar comments
+1 |
+1 |
+1 |
2 similar comments
+1 |
+1 |
Any news about the new version ? |
The proposed fix is quite a hack. It fixes one NPE and then tacks a bunch of empty |
I agree with @derekm.. the proposed fix seems pretty wrong. There must be a solution that doesn't simply swallow all unhandled rejections, which is pretty reckless. |
Whoa, these comments. Does anyone even know how Angular works? Angular's $timeout returns promise and all they did was just add a warning to all promises that do not have both results handled. In case of $timeout this is just redundant, because $timeout itself cannot ever result with an error and if you cancel it manually, you care even less. Take a look at Angular's $timeout.cancel implementation:
Does that comment ring any bell? |
I fear this is going to turn into a flame war, but I personally DO agree with the changes. By supplying a Also, if you are coding promises according to spec, you aren't using the |
wut? |
Any idea about when is ui-grid planning to support Angular JS 1.6 version? |
Any update on this? |
+1 |
I don't know whether ui-grid already handles these cases but if not, you can configure angular to ignore unhandled promise rejections (reverting to pre-1.6.0 behavior).
|
+1 |
+1 |
I get the same error running the ui-grid for the first time using Angular 1.6.4. |
+1 |
6 similar comments
+1 |
+1 |
+1 |
+1 |
+1 |
+1 |
+1!! |
fixed this trouble in https://github.com/cybermerlin/ui-grid/tree/develop |
+1 |
1 similar comment
+1 |
Click on column header to sort data and it throws "Possibly unhandled rejection: canceled" error under Angular 1.6.
http://plnkr.co/edit/bXEXwcvHz1dK655nHpeT?p=preview
The text was updated successfully, but these errors were encountered: