Skip to content

Default router serialization is not compatible with immutability check #1937

Closed
@jonr-elsewhen

Description

@jonr-elsewhen

Minimal reproduction of the bug/regression with instructions:

The "strictStateImmutability" runtime check is enabled by default in NgRx 8. This check is not compatible with @ngrx/router-store, because the default router state cannot be safely made immutable: #1104 (comment)

  1. Create a Angular project without routing enabled.
  2. Add @ngrx/store
  3. Add @ngrx/router

Browse the app. You will get the following in the console:

Attempting to configure '__source' with descriptor '{"value":"StaticContentPipe","configurable":true}' on object 'InjectionToken STATIC_CONTENT_CONTEXT' and got error, giving up: TypeError: Cannot redefine property: __source

Expected behavior:

The "strictStateImmutability" check should skip freezing the router store by default.

Versions of NgRx, Angular, Node, affected browser(s) and operating system(s):

NgRx: 8
Angular: 8

I would be willing to submit a PR to fix this issue

[x] Yes
[ ] No

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