Unhandled rejection check causes errors in Firefox
See original GitHub issue- Bluebird 3.7.0
- Firefox 71 (Nightly)
I recently upgraded from Bluebird 3.5.5 to 3.7.0, which happens to pull in the unhandled rejection handling from https://github.com/petkaantonov/bluebird/commit/60ef7a0e23fd320a11281f67c64a39ff95612ce9 (first added in 3.6.0).
The path which adds an iframe
, grabs setTimeout
from it, then removes it from the document does not appear to work in Firefox 71. Instead, calling this setTimeout
fails with an NS_ERROR_NOT_INITIALIZED
exception.
(As an aside, I am curious why you want to pull setTimeout
from a throwaway frame like this… Why not just use the main document?)
For now, I will revert back to 3.5.5.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:11
- Comments:10 (1 by maintainers)
Top Results From Across the Web
Window: unhandledrejection event - Web APIs | MDN
The unhandledrejection event is sent to the global scope of a script when a JavaScript Promise that has no rejection handler is rejected; ......
Read more >Unhandled promise rejection - Firefox - Stack Overflow
I am using the latest version of FF and this code works in the latest version of Chrome and even Ie 11. Unhandled...
Read more >Logging And Debugging Unhandled Promise Rejections In ...
If a Promise chain contains an error that is swallowed, it can lead to strange behaviors and hard to debug issues in your...
Read more >Uncaught errors in Node.js and the browser
log('Unhandled Rejection at:', promise, 'reason:', reason);. });. readFile('./non-existent- ...
Read more >Error Messages | Cypress Documentation
Test File Errors No tests found This message means that Cypress was unable ... or its unhandledrejection handler, Cypress will detect it and...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
As described here, Bluebird creates an
iframe
, takes itssetTimeout
function and then removes theiframe
from the DOM. It then uses that function to schedule checks for unhandled rejections.I suspect that Firefox destroys the window of the
iframe
when it’s removed from the DOM, and as such thesetTimeout
function becomes invalid.Can’t we capture the original value of
setTimeout
while Bluebird is loading, and always use that insidedeferUnhandledRejectionCheck
? That way, Bluebird would not be affected by a test framework replacing the globalsetTimeout
afterwards. It would also be much simpler, without needing platform-specific specializations.I was experiencing this bug as well and the newly released version 3.7.2 fixed it for me.