Skip to content

PromiseRejectionEvent not fired #55590

Closed

Description

@Joozty

Which @angular/* package(s) are the source of the bug?

zone.js

Is this a regression?

No

Description

The PromiseRejectionEvent is not triggered when zone.js is included on the webpage. The issue stems from zone.js's inability to construct a PromiseRejectionEvent because options parameter is undefined - { promise: undefined, reason: undefined }

Event is not fired and silently ignored here: https://github.com/angular/angular/blob/main/packages/zone.js/lib/common/promise.ts#L82
Fails to construct PromiseRejection error here: https://github.com/angular/angular/blob/main/packages/zone.js/lib/browser/browser.ts#L316

image

Here is a minimal example to reproduce the issue. Note that if you remove the zone.js script, the event fires as expected.

<!doctype html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<title>Title</title>
		<script src="https://cdn.jsdelivr.net/npm/[email protected]/bundles/zone.umd.min.js"></script>
	</head>
	<body>
		<script>
			window.addEventListener('unhandledrejection', (event) =>
				console.log('unhandledrejection', event, event.promise, event.reason),
			)

			const scriptEl = document.createElement('script')
			scriptEl.innerHTML = "Promise.reject('Error happened :(')"
			document.body.append(scriptEl)
		</script>
	</body>
</html>

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

No response

Please provide the environment you discovered this bug in (run ng version)

zone.js: latest

Anything else?

No response

Activity

  1. added this to the needsTriage milestone on Apr 30, 2024
  2. axue3 commented on Nov 12, 2025

    @axue3
    Contributor

    Hey, I'd like to work on this!

  3. added 2 commits that reference this issue on Apr 11, 2026
    acf8233
    45a4650
  4. added a commit that references this issue on Apr 15, 2026
    eddca42
  5. added a commit that references this issue on Apr 15, 2026
    fc6a7ee
  6. angular-automatic-lock-bot commented on May 16, 2026

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  7. locked and limited conversation to collaborators on May 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: zonesIssues related to zone.js

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions