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

HMR does not work with class-components loaded in the router #521

Closed
Evertvdw opened this issue Mar 23, 2021 · 4 comments
Closed

HMR does not work with class-components loaded in the router #521

Evertvdw opened this issue Mar 23, 2021 · 4 comments

Comments

@Evertvdw
Copy link

Hello there, there seems to be a HMR issue when using vue-class-components in Vue3. It seems to have to do with components that are loaded in the routes. I created a codesandbox to reproduce this issue:

https://codesandbox.io/s/fervent-haibt-htft9?file=/src/App.vue

In the 'App.vue' I created a class component in which HMR does work, try changing the text and you see it updated on the screen.
In Index.vue which is put into a router-view in the routes.js file, HMR works when you use the old options syntax, but when you use the class syntax the HMR does not work anymore.

This is of course not a very nice developer experience, can this be fixed?

@hjmmc
Copy link

hjmmc commented Jun 16, 2021

Now I rewrite the webpackHotUpdate method to achieve page auto refresh, of course this is only a temporary fix.

window.webpackHotUpdate = function () {
  window.location.reload()
}

@bamboechop
Copy link

HMR not working for components that are loaded via the router is a deal breaking issue for my new projects right now. Can this problem please be acknowledged and either a timeline be given when a fix will be released or at least said that no fix is coming?

@MatthewSH
Copy link

Another issue for Quasar was created (quasarframework/quasar#10527) because of this issue. I did some initial work for tracking it down over there (see here: quasarframework/quasar#10527 (comment) ).
Would be nice if the issue was at least acknowledged by the devs.

However, I am concerned that the project is currently sitting inactive on all branches while issues sit open.

@IlCallo
Copy link

IlCallo commented Nov 4, 2021

The problem apparently is into vue-loader itself, see vuejs/vue-loader#1897

@Evertvdw Evertvdw closed this as completed Nov 4, 2021
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

5 participants