You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which @angular/* package(s) are the source of the bug?
zone.js
Is this a regression?
No
Description
window.addEventListener takes an options argument, which can be shaped as { signal: AbortSignal }. AbortController satisfies this interface, and can be passed to addEventListener in the native implementation:
window.addEventListener('keydown', () => {}, new AbortController)
However, zone.js is clever with passing the signal, and un-assigns and re-assigns it to taskData.options avoid passing it internally. taskData.options is initialized to the original options argument, so it is initialized to an instance of AbortController, for which signal is a getter. This results in a TypeError. Instead, for this to work in zone.js, you need to destructure:
window.addEventListener('keydown', () => {}, { signal: (new AbortController).signal })
zone.js should not be using the original options argument (to save memory) and assigning to it, as it is of an unknown type and the options properties may not be writable.
Please provide a link to a minimal reproduction of the bug
N/A - see explanation for one-liners
Please provide the exception or error you saw
TypeError: Cannot set property signal of [object AbortController] which has only a getter
Please provide the environment you discovered this bug in (run ng version)
zone.js: 0.14.4
Google Chrome: 122.0.6261.94 (Official Build) (arm64)
Anything else?
No response
The text was updated successfully, but these errors were encountered:
Which @angular/* package(s) are the source of the bug?
zone.js
Is this a regression?
No
Description
window.addEventListener
takes an options argument, which can be shaped as{ signal: AbortSignal }
.AbortController
satisfies this interface, and can be passed toaddEventListener
in the native implementation:However,
zone.js
is clever with passing thesignal
, and un-assigns and re-assigns it totaskData.options
avoid passing it internally.taskData.options
is initialized to the original options argument, so it is initialized to an instance ofAbortController
, for whichsignal
is a getter. This results in aTypeError
. Instead, for this to work inzone.js
, you need to destructure:zone.js
should not be using the original options argument (to save memory) and assigning to it, as it is of an unknown type and the options properties may not be writable.Please provide a link to a minimal reproduction of the bug
N/A - see explanation for one-liners
Please provide the exception or error you saw
Please provide the environment you discovered this bug in (run
ng version
)Anything else?
No response
The text was updated successfully, but these errors were encountered: