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

Two Vue runtimes on client #157

Closed
Tracked by #480
tobiasdiez opened this issue Dec 3, 2021 · 5 comments
Closed
Tracked by #480

Two Vue runtimes on client #157

tobiasdiez opened this issue Dec 3, 2021 · 5 comments
Labels
bridge bug Something isn't working vite

Comments

@tobiasdiez
Copy link
Contributor

Environment

  • Operating System: Windows_NT
  • Node Version: v16.13.1
  • Nuxt Version: 2.16.0-27308177.ab1c6cb4
  • Package Manager: yarn@1.22.15
  • Bundler: Webpack (not sure why this is reporting webpack, but Vite is activated and used)
  • User Config: target, bridge, ssr, buildModules
  • Runtime Modules: -
  • Build Modules: @nuxt/bridge@3.0.0-27307420.6a25d3e

Reproduction

https://github.com/tobiasdiez/bridge-test

Start with yarn dev and then go to the browser console.

Describe the bug

If Vue is imported in a store (in my case this originally happened via pinia) and the composition api is used, then two Vue runtimes are present in the browser (see screenshot below from the browser console).
One is loaded directly from node_modules/vue/dist (the one imported via the store) and the other one from a chunk in node_modules/.cache/vite/client (the one imported via the composition API).
This duplication of runtimes leads to further problems with some libraries.

image

Additional context

No response

Logs

No response

@yassilah
Copy link
Contributor

yassilah commented Dec 6, 2021

Hi, I can confirm I'm having the same issue. The only thing I know is that it must be due to a very recent update of @nuxt/bridge as I was not getting this error until yesterday after updating my lockfile. I'll try to see which version is responsible for this.

@yassilah
Copy link
Contributor

yassilah commented Dec 6, 2021

It seems the issue goes away when forcing this version of @nuxt/kit in package.json:

"dependencies": {
    "@nuxt/kit": "npm:@nuxt/kit-edge@3.0.0-27304790.cad09fe",
    "@nuxt/kit-edge": "3.0.0-27304790.cad09fe"
}

The issue starts with version 3.0.0-27306007.d52acbf, so I'd assume it's due to this commit?

@danielroe danielroe added vite bug Something isn't working and removed pending triage labels Dec 6, 2021
@tobiasdiez
Copy link
Contributor Author

@danielroe @antfu I tried to further investigate this issue and provide a PR fixing it, but I am a bit lost on where to start. Do you have any idea what is triggering the second import? Also which of the two imports is the correct one?

@tobiasdiez
Copy link
Contributor Author

For me this is now fixed in the latest version. @yassilah if its also working for you now, then we can close this issue.

@yassilah
Copy link
Contributor

yassilah commented Jan 6, 2022

yeah, it's fixed as well 🙂

@pi0 pi0 transferred this issue from nuxt/framework Apr 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bridge bug Something isn't working vite
Projects
None yet
Development

No branches or pull requests

3 participants