Skip to content

Missing types in subscribe's mutation.events #1117

Closed Locked Answered by posva
maximelebreton asked this question in Help and Questions
Discussion options

You must be logged in to vote

mutation.events is a feature that is only available during development, it won't work in production. It comes from vue watchers (https://vuejs.org/guide/extras/reactivity-in-depth.html#component-debugging-hooks). It's only safe to use this information for devtools plugins .

The reason of your error is actually unrelated to this: the type of mutation.events is DebuggerEvent | DebuggerEvent[], it's sometimes an array, sometimes one single event, that's why you can read mutation.events.key, you need something like Array.isArray(mutations.events) ? ... : mutations.events.key

Replies: 6 comments 7 replies

Comment options

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

@miraclebg
Comment options

Comment options

You must be logged in to vote
5 replies
@dskvr

This comment has been hidden.

@kub1x
Comment options

@frammkor
Comment options

@mrehacek
Comment options

@pipwerks
Comment options

Answer selected by posva

This comment was marked as disruptive content.

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Converted from issue

This discussion was converted from issue #1110 on March 04, 2022 09:30.