The Wayback Machine - https://web.archive.org/web/20210104174403/https://github.com/vuejs/vuex-router-sync/pull/93
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: clone route outside of mutation #93

Open
wants to merge 1 commit into
base: master
from

Conversation

@cjpearson
Copy link

@cjpearson cjpearson commented Nov 5, 2019

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 the matched array of the route.

@kiaking
Copy link
Member

@kiaking kiaking commented Apr 23, 2020

Hi thanks for the PR and sorry for the late response. Could you provide the reproduction code for this?

@kiaking
Copy link
Member

@kiaking kiaking commented Apr 30, 2020

Closing due to inactivity.

@kiaking kiaking closed this Apr 30, 2020
@cjpearson
Copy link
Author

@cjpearson cjpearson commented May 7, 2020

@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.

@kiaking
Copy link
Member

@kiaking kiaking commented May 9, 2020

@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?

@kiaking kiaking reopened this May 9, 2020
@cjpearson
Copy link
Author

@cjpearson cjpearson commented May 11, 2020

Yeah I can take a crack at that.

@kiaking
Copy link
Member

@kiaking kiaking commented May 11, 2020

@cjpearson Thanks a lot! In that case, please rebase the branch to the latest master branch. Now we're writing everything in TS 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.