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

Vite HMR stops working, when importing a async composable twice #12036

Closed
chrispreisler opened this issue Oct 15, 2021 · 3 comments
Closed

Vite HMR stops working, when importing a async composable twice #12036

chrispreisler opened this issue Oct 15, 2021 · 3 comments

Comments

@chrispreisler
Copy link

Environment

  • Operating System: Darwin
  • Node Version: v16.5.0
  • Nuxt Version: 3-3.0.0-27238235.a1bcc53
  • Package Manager: Yarn
  • Bundler: Webpack
  • User Config: build
  • Runtime Modules: -
  • Build Modules: -

Describe the bug

I have created a composable to fetch data. I import the composable two times. Once in the app.vue and once in the pages/[..slug].vue. The code itself is working as intended, but when I change something in one of the files hmr stops working and I get an error, but only when I change something the app.vue.

Thanks for your help guys.

Reproduction

https://stackblitz.com/edit/github-zdtycq?file=app.vue

Additional context

No response

Logs

I got this logs, when changing something in the app.vue

runtime-core.esm-bundler.js:140 TypeError: instance.update is not a function
    at runtime-core.esm-bundler.js:62
    at Array.forEach (<anonymous>)
    at rerender (runtime-core.esm-bundler.js:54)
    at Object.rerender (runtime-core.esm-bundler.js:137)
    at app.vue:13
    at client.ts:424
    at client.ts:345
    at client.ts:205
    at Array.forEach (<anonymous>)
    at queueUpdate (client.ts:205)
(anonymous) @ runtime-core.esm-bundler.js:140
(anonymous) @ app.vue:13
(anonymous) @ client.ts:424
(anonymous) @ client.ts:345
(anonymous) @ client.ts:205
queueUpdate @ client.ts:205
async function (async)
queueUpdate @ client.ts:201
(anonymous) @ client.ts:72
handleMessage @ client.ts:70
(anonymous) @ client.ts:44
runtime-core.esm-bundler.js:141 [HMR] Something went wrong during Vue component hot-reload. Full reload required.
@mkhennoussi
Copy link

Maybe related to #11956 ?

@danielroe
Copy link
Member

danielroe commented Nov 19, 2021

This should now be resolved. 👍

@chrispreisler
Copy link
Author

Yes, thanks so much for looking into that and all the great effort you guys put in this framework.

@danielroe danielroe added the 3.x label Jan 19, 2023
@danielroe danielroe transferred this issue from nuxt/framework Jan 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants