Skip to content

TypeError: stateSource[STATE_SOURCE].update is not a function in NgRx Signals #4511

Discussion options

You must be logged in to vote

Uff, that's a lot of code. Try to unset the protectedState like this:

export const GroupRatingStore = signalStore(
  { providedIn: 'root', protectedState: false },
  withEntitiesAndDBMethods<GroupRating>('groupRatings'),
);

If everything works, you tried to patch outside of the SignalStore which is disabled since the stable release: https://dev.to/ngrx/announcing-ngrx-signals-v18-state-encapsulation-private-store-members-enhanced-entity-management-and-more-2lo6

You can leave your GroupRatingStore state unprotected, but we recommend that every state update, i.e., calling patchState, happens inside the SignalStore. That might require some refactoring on your side.

If there are still some un…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
2 replies
@alidezhihui
Comment options

@davidtlee
Comment options

Comment options

You must be logged in to vote
1 reply
@davidtlee
Comment options

Answer selected by alidezhihui
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants