#5183·platform

`@ngrx/signals`: `patchState` blocks when State signal throws an error

Author: rainerhahnekampCreated Jul 1, 2026Updated Jul 3, 2026
LabelsProject: Signals

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

signals

Minimal reproduction of the bug/regression with instructions

Signals can throw an error when they are accessed. This can happen for state slices that are backed by APIs like resource or linkedSignal.

patchState currently calls getState internally before applying an update, so it eagerly reads every state slice. As a result, patching an unrelated state slice can lead to a dead-end, in that sense that other state slices are not patchable anymore.

Reproduction

typescript
const Store = signalStore(
  { providedIn: 'root', protectedState: false },
  withState({ name: '' }),
  withLinkedState(() => {
    const { value } = resource({
      loader: async () => {
        throw new Error('Failed to load value.');
      },
    });

    return { value };
  })
);

const store = inject(Store);

patchState(store, { name: 'John' });

Expected behavior

It should not block

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

NgRx 21

Other information

No response

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

  • Yes
  • No