script setup
sometimes generate invalid code when using defineEmit
and defineProps
#2740
Labels
❗ p4-important
Priority 4: this fixes bugs that violate documented behavior, or significantly improves perf.
has workaround
A workaround has been found to avoid the problem
🐞 bug
Something isn't working
scope: compiler
Version
3.0.4
Reproduction link
https://github.com/leopiccionia/vue-script-setup-emit-repro
Steps to reproduce
Just run the repro, with
npm run dev
.What is expected?
Compiler should generate valid code.
What is actually happening?
Code fails with syntax error.
The problem is in this line from output:
The preceding comma is not valid in this place of
import
statement.A workaround is changing the order of imports, so that
defineEmit
anddefineProps
are trailing.I'm not sure if this is a Vite-specific error. I can move the issue, if needed.
The text was updated successfully, but these errors were encountered: