Skip to content

Uncaught (in promise): TypeError: Class constructor DirtyCheckGuard cannot be invoked without 'new' #31

@georgecohen

Description

@georgecohen

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[X] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

Current behavior

When I leave the page, I got an error:

Uncaught (in promise): TypeError: Class constructor DirtyCheckGuard cannot be invoked without 'new'\nTypeError: Class constructor DirtyCheckGuard cannot be invoked without 'new'\n at new DirtyGuard (https://localhost:5300/src_app_layout_products_products_module_ts.js:23:19)\n at Object.DirtyGuard_Factory [as factory] (https://localhost:5300/src_app_layout_products_products_module_ts.js:29:12)\n at R3Injector.hydrate (https://localhost:5300/vendor.js:56921:29)\n at R3Injector.get (https://localhost:5300/vendor.js:56822:23)\n at R3Injector.get (https://localhost:5300/vendor.js:56831:27)\n at R3Injector.get (https://localhost:5300/vendor.js:56831:27)\n at getTokenOrFunctionIdentity (https://localhost:5300/vendor.js:134858:27)\n at https://localhost:5300/vendor.js:135152:19\n at Array.map ()\n at runCanDeactivate (https://localhost:5300/vendor.js:135150:50)

Expected behavior

Minimal reproduction of the problem with instructions

What is the motivation / use case for changing the behavior?

Environment


Angular version: 15.0.2


Browser:
- [X] Chrome (desktop) version 107.0.5304.107
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
 
For Tooling issues:
- Node version: 18  
- Platform:  Windows 11

Others:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions