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

(Vue 3) singleSpa.navigateToUrl is clashing with vue-router #89

Open
jaydgruber opened this issue Sep 23, 2021 · 5 comments
Open

(Vue 3) singleSpa.navigateToUrl is clashing with vue-router #89

jaydgruber opened this issue Sep 23, 2021 · 5 comments

Comments

@jaydgruber
Copy link

vue-router seems to be intercepting events after it should have already been destroyed.

It seems like after single-spa tells the vue app to unmount, vue-router is continuing to try and catch routing events.
This looks related to vuejs/vue-router#3172, but I am not sure on the dovetail relationship between the vue-router (v3) & vue-router-next (v4) repos.

As far as I can tell, this is an issue with vue-router 4, but not with vue-router 3.

I made an small example repro. To be clear, I don't think this is an issue with having two different versions of Vue loaded on the same page. The work repo where I encountered this issue is using 1 React app & 1 Vue app. I made the repro with two different versions of Vue to illustrate that (Vue 2 / vue-router 3) seems fine, while (Vue 3 / vue-router 4) seems to have a problem.

example repo illustrating the problem

@joeldenning
Copy link
Member

I have diagnosed some vue router problems for Vue 3 in other issues, but didn't easily find the links to those issues. The issue you linked to is for Vue 2's router, not vue 3's router. I don't really have a desire to clone and test out the repo right now, but may do so later. Feel free to remind me in a few weeks if I have not done so.

@jaydgruber
Copy link
Author

jaydgruber commented Oct 25, 2021

👍 I linked the issue from Vue 2's router because I think the same type of issue may also need to be fixed in Vue 3's router (Remove event listeners when all apps are destroyed).

@gerrue
Copy link

gerrue commented Jun 16, 2022

@jaydgruber @joeldenning I see that there is some code in the vue-router that is supposed to support multi-apps https://github.com/vuejs/router/blob/8769fa17c1784ff701091d141c1769492e81d7e9/src/router.ts#L1218 do either of you know if this is working?

@eolamisan
Copy link

Any luck with this issue?

@jaydgruber
Copy link
Author

@eolamisan sorry I never found a fix for this one. My work pivoted our project that was going to use single-spa to instead build an in-house service that sort of resembles Astro Islands.

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

No branches or pull requests

4 participants