Closed cjpearson closed 2 months ago
Hi thanks for the PR and sorry for the late response. Could you provide the reproduction code for this?
Closing due to inactivity.
@kiaking Sorry for the late reply. I've created a demo here. Basically anything that attempts to log or persist mutations can be tripped up by the payload of the ROUTE_CHANGE
mutations.
The simplest way to create an error is with a mutation logger which attempts to stringify the payload.
If you attach vue-devtools to the page and enable the new vuex backend, you'll also get errors there as it attempts to clone the mutation. The cloning logic there is different and it doesn't always throw an error when cloning a component.
@cjpearson Ah, thank you so much for checking in. OK now I see the problem here. Would it be possible for you add a test for this?
Yeah I can take a crack at that.
@cjpearson Thanks a lot! In that case, please rebase the branch to the latest master
branch. Now we're writing everything in TS 👍
This change moves to call to
cloneRoute
outside of the mutation and passes the already-cloned route as the payload. It fixes some console errors that might occur when the vue-devtools extension tries to clone the mutation payload. In my case there were errors when it attempted to clone components within thematched
array of the route.