Skip to content

setTimeout in interceptor causes error with/in EventReplay #56423

@phihochzwei

Description

@phihochzwei

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

platform-browser

Is this a regression?

No

Description

When using EventReplay via withEventReplay(), we receive an error inside one of our interceptors, in the marked line in the interceptor we use 'setTimeout'

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

`TypeError: Cannot read properties of undefined (reading '_ejsa')
    at getJsactionData (core.mjs:36732:22)
    at initEventReplay (core.mjs:36740:31)
    at core.mjs:36716:29
    at _ZoneDelegate.invoke (zone.js:368:26)
    at Object.onInvoke (core.mjs:15898:33)
    at _ZoneDelegate.invoke (zone.js:367:52)
    at Zone.run (zone.js:129:43)
    at zone.js:1257:36
    at _ZoneDelegate.invokeTask (zone.js:402:31)
    at core.mjs:15583:55
    at AsyncStackTaggingZoneSpec.onInvokeTask (core.mjs:15583:36)
    at _ZoneDelegate.invokeTask (zone.js:401:60)
    at Object.onInvokeTask (core.mjs:15885:33)
    at _ZoneDelegate.invokeTask (zone.js:401:60)
    at Zone.runTask (zone.js:173:47)`

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

_                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 18.0.3
Node: 22.2.0
Package Manager: npm 10.7.0
OS: darwin arm64

Angular: 18.0.3
... animations, cdk, cli, common, compiler, compiler-cli, core
... forms, google-maps, language-service, material
... platform-browser, platform-browser-dynamic, platform-server
... router, service-worker, ssr

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1800.3
@angular-devkit/build-angular   18.0.3
@angular-devkit/core            18.0.3
@angular-devkit/schematics      18.0.3
@schematics/angular             18.0.3
ng-packagr                      18.0.0
rxjs                            7.5.7
typescript                      5.4.3
webpack                         5.91.0
zone.js                         0.14.3

Anything else?

No response

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: coreIssues related to the framework runtimecore: event dispatchstate: has PR

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions