nuxt / bridge

🌉 Experience Nuxt 3 features on existing Nuxt 2 projects
MIT License
273 stars 29 forks source link

Error in setup: "Error: Instance $root not found" #400

Closed Luferov closed 10 months ago

Luferov commented 2 years ago

Environment

Reproduction

git clone https://github.com/devind-team/dcis
cd client
rm -r node_modules && rm yarn.lock && yarn
yarn run dev

Open browser: browser is always loading

Describe the bug

I want to upgrade project up latest version of nuxt/bridge.

We use composition api and after run dev got this error: image

Additional context

Use apollo and pinia.

Logs

No response

danielroe commented 2 years ago

Would you please provide a more minimal reproduction? I can't run this as it seems to need a graphql server running, etc.

https://stackblitz.com/github/nuxt/starter/tree/v2-bridge

Luferov commented 2 years ago

Error may depend with getCurrentInstance.

https://stackblitz.com/edit/github-5xqxyf?file=layouts%2Fdefault.vue,pages%2Findex.vue,composables%2Findex.ts

danielroe commented 2 years ago

Stackblitz had an internal bug logging the vm instance. But otherwise the sandbox seems to be working: https://stackblitz.com/edit/github-5xqxyf-wxr7av

github-actions[bot] commented 10 months ago

Would you be able to provide a reproduction? 🙏

More info ### Why do I need to provide a reproduction? Reproductions make it possible for us to triage and fix issues quickly with a relatively small team. It helps us discover the source of the problem, and also can reveal assumptions you or we might be making. ### What will happen? If you've provided a reproduction, we'll remove the label and try to reproduce the issue. If we can, we'll mark it as a bug and prioritise it based on its severity and how many people we think it might affect. If `needs reproduction` labeled issues don't receive any substantial activity (e.g., new comments featuring a reproduction link), we'll close them. That's not because we don't care! At any point, feel free to comment with a reproduction and we'll reopen it. ### How can I create a reproduction? We have a couple of templates for starting with a minimal reproduction: 👉 https://stackblitz.com/github/nuxt/starter/tree/v2-bridge 👉 https://codesandbox.io/p/github/nuxt/starter/v2-bridge-codesandbox A public GitHub repository is also perfect. 👌 Please ensure that the reproduction is as **minimal** as possible. See more details [in our guide](https://nuxt.com/docs/community/reporting-bugs/#create-a-minimal-reproduction). You might also find these other articles interesting and/or helpful: - [The Importance of Reproductions](https://antfu.me/posts/why-reproductions-are-required) - [How to Generate a Minimal, Complete, and Verifiable Example](https://stackoverflow.com/help/mcve)