-
Notifications
You must be signed in to change notification settings - Fork 432
How can I add hot reload with ES6 class declaration? #65
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
Comments
Yes you can. You either need vue-loader, or manually use vue-hot-reload-api. |
I created the class: import Vue from 'vue'; @component({}) --- But hot reload does not work. I am using "vue-loader": "^10.3.0" of webpack template.
|
@phenrigomes |
@ktsn I got the same problem.
It just doesn't reload the changes. Once you reload it in the browser (f5) the changes are there. |
We can't help you without actual reproduction... |
@ktsn sure, here it is: Used the vuetifyjs/webpack-ssr template as a starting point and added babel and vue-typed (which uses the class component thing). Thanks for looking into this :) |
Thank you for supporting Vue. But we do need your further collaboration. To address issue efficiently, we need minimal reproduction. webpack-simple is a good start. You can first incrementally add code until issue happens. Then, to make code minimal, you can selectively delete script/style/template that does not influence the issue. Usually, style is irrelevant and safe to delete. You need also apply this rule to webpack configuration where most problems happen there. |
I tried to reproduce it using the webpack-simple template, but weirdly enough it works without problems there. So it seems like the issue is caused by something else. I'll look further into this in the evening. |
I can also confirm that vue-class-component is having problems with hot-reload. The hot-reload usually works once and then after that it stops working. I am using vue-cli webpack template. EDIT: Also I am using with typescript / ts-loader, following the tutorial here: http://www.mindissoftware.com/Vue-Sample-in-Typescript/ (adapted it to the latest webpack template) |
Related TypeStrong/ts-loader#433 |
Also likely the same issue as this one: TypeStrong/ts-loader#459 |
Here is the reproduction: See: There are at least 2 issues. One is when using |
I currently have the same issue using babel-loader |
For reference after trying av-ts regarding hot-reload, it isn't perfect but still behaves better. There are no full page reloads, just that sometimes the hot-reload doesn't want to update. So I think there is likely some underlying issue that is causing problems and also issues in vue-class-component itself. |
I find there is a bug in core library that accidentally drop late-injected options of constructors. That means, if we use vue-hot-reload-api or vue-loader, they inject some options into component options object after creating component constructors, then the component is instantiated by using constructor with Actually, #66 is same problem as this. |
Simplified repro. https://jsfiddle.net/vvxLyLvq/2/ |
Has there been an issue for this bug created in the vue core github yet and should there be? |
No not yet. It would be appreciated if you can create in there 🙂 |
@chanon Thank you for creating the issue in core repo! Let's move on vuejs/vue#4976 |
No description provided.
The text was updated successfully, but these errors were encountered: