question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

PromiseRejectionEvent does not conform to spec again

See original GitHub issue
  1. What version of bluebird is the issue happening on? 3.5.1

  2. What platform and version? (For example Node.js 0.12 or Google Chrome 32) Testing in Chrome 67, but it’s irrelevant

  3. Did this issue happen with earlier version of bluebird? Do not know

Event objects fired with unhandledrejection and rejectionhandled do not conform to PromiseRejectionEvent specification: They do not have reason and promise properties, instead they have detail property which contains the two.

This issue was already raised as #1447 and fixed in #1464 And evidently the code is still there in master.

But it’s gone in the build. Here’s the snipped from bluebird.core.js as compiled by default and as linked on the site (https://cdn.jsdelivr.net/bluebird/latest/bluebird.core.js):

		var fireDomEvent = (function() {
			try {
				if (typeof CustomEvent === "function") {
					var event = new CustomEvent("CustomEvent");
					util.global.dispatchEvent(event);
					return function(name, event) {
						var domEvent = new CustomEvent(name.toLowerCase(), {
							detail: event,
							cancelable: true
						});
						return !util.global.dispatchEvent(domEvent);
					};
				} else if (typeof Event === "function") {
// ...

For some reasons, property defines are gone. I imagine this is either issue with build scripts or es5.defineProperty shim.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:15 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
gennecommented, Jun 29, 2018

Any plans on doing a new release to fix this issue?

1reaction
Whoaa512commented, Apr 12, 2018

Looks like this is not due to build issues. The commit which adds the property defines was merged on Oct 6, 2017 and 3.5.1 was released on Oct 4, 2017

@petkaantonov or @benjamingr would you mind releasing a patch version to get this updated?

Read more comments on GitHub >

github_iconTop Results From Across the Web

PromiseRejectionEvent() - Web APIs - MDN Web Docs
A rejectionhandled event is emitted if a promise is rejected but the rejection is caught by a rejection handler. Syntax. new ...
Read more >
Support for promise rejection events (unhandledrejection)
A few things that need to be handled: - PromiseRejectionEvent - when constructed with a value for "promise" that is not an instance...
Read more >
How do I fail a test in Jest when an uncaught promise rejection ...
I commented below stating that the issue actually seems to be promise rejections deeper in the code that aren't being passed back up...
Read more >
Frequently Asked Questions - Jasmine Documentation
By default, Jasmine doesn't require specs to contain any expectations. You can enable that behavior by setting the failSpecWithNoExpectations option to true ......
Read more >
Window: rejectionhandled event
However, Firefox doesn't yet actually send the unhandledrejection or understand rejectionhandled events. Completing the implementation will ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found