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

How to resolve the warning "[portal-vue]: source source already exists" ? #330

Open
robskrob opened this issue Mar 29, 2021 · 1 comment

Comments

@robskrob
Copy link

After making an HTTP request for a page's HTML using axios, I am replacing the current page's HTML markup with the markup from the response of the request I made with vanilla JS. However, I am noticing this warning, [portal-vue]: source source already exists, and I am not too sure if I need to be very concerned about this warning log.

I've looked at the source and where the registerSource function is invoked to better understand the warning. Just before replacing the old markup with the new markup I am querying the old markup and passing $destroy() to the "old" components. Based on what I can tell from the source I have linked, portal-vue will "unregister" the components before they are destroyed. I was hoping that effectively unregistering components on the page would suppress the warning log -- [portal-vue]: source source already exists -- but that does not seem to have stopped the log from firing.

Are there more components for me to $destroy from the old markup that I am replacing? Is destroying old components the way to go in order to resolve the above warning -- if not, what way is the correct way to resolve the above warning?

Should I be concerned about the warning in general?

@idenc
Copy link

idenc commented Aug 24, 2021

I had to manually unregister the source using Wormhole.unregisterSource(name) to get the warning to go away

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

2 participants