-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
vue2 tsx (class component) hmr exception #11008
vue2 tsx (class component) hmr exception #11008
Comments
can you provide a mini-repro? |
Hello @eleven-net-cn. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with |
Here it is: |
I found this bug happens because of vite/packages/plugin-vue/src/handleHotUpdate.ts Lines 64 to 78 in d6b4ee5
Not sure what is the right way to fix it. Any suggestions?? @bluwy @sapphi-red. I can offer a PR. |
The reproduction is using @sun0day Do you mean this happens with plugin-vue + plugin-vue-jsx as well? If so I think it's better to create a PR directly because it's easier to discuss. |
The Plus, I can ensure this happens in I will give a try to offer a PR, let's discuss there. @sapphi-red |
@sun0day thanks for the fix! Has this issue been created also in the vite-plugin-vue2 repo? |
I'd love to, I will give a try |
Describe the bug
vite@3 + vue2 + class component + tsx
When use
lang="tsx"
and class component, the vite hmr error.See below about "Steps to reproduce" for details.
Reproduction
--
Steps to reproduce
dependencies
set
lang="tsx"
an error occurred when changed the get property, e.g.:
changed
v-model
andget test
totest1
vite hmr
we can find two requests in the network
.../form/index.vue?t=1668996911179
It‘s right, the content is as follows
.../form/index.vue?t=1668996911179&vue&type=script&lang.tsx
Here is error, the content is still
test
Everything works fine when not using tsx (set
lang="ts"
), because only one hmr request (.../form/index.vue?t=1668996911179
).And, if I continue to add the
set test1() {}
, even if I add a new line, sometimes, the hmr request content is fine.System Info
Used Package Manager
yarn
Logs
The error logs:
Validations
The text was updated successfully, but these errors were encountered: