Open abitwhy opened 2 years ago
Hello @abitwhy. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with need reproduction
will be closed if they have no activity within 3 days.
I tested with https://vite.new/vue but didn't happen.
Would you write the steps to reproduce?
@sapphi-red The reproduce steps were added in the top comment.
Please write more concrete steps.
I'm still not able to reproduce.
I edited HelloWorld.vue
in the following steps.
<script setup>
import { ref } from 'vue'
defineProps({
msg: String
})
const count = ref(0)
</script>
<script setup>
import { ref } from 'vue'
defineProps({
msg: String
})
const count = ref(0)
console.log(
</script>
<script setup>
import { ref } from 'vue'
defineProps({
msg: String
})
const count = ref(0)
console.log()
</script>
Check this:
After more testing, I found that only no-undef error will case this bug.
I was able to reproduce 👍
Describe the bug
Any
undef
error in the<script setup>
will break the HMR. If auto save file is on, then entering any incomplete code will cause an error and break the HMR.Break means it no longer working, even if correct the code. And only fresh the page will make HMR work. This happened only recently, and only happened in
<script setup>
.Reproduction
https://vite.new/vue
Reproduce Steps
src/App.vue
undef
error in<script setup>
(For example, write some characters in a new line)System Info
Used Package Manager
npm
Logs
No response
Validations