Skip to content

Incorrect error message when <script> <script setup> has different languages #13193

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

Open
typed-sigterm opened this issue Apr 12, 2025 · 0 comments · May be fixed by #13194
Open

Incorrect error message when <script> <script setup> has different languages #13193

typed-sigterm opened this issue Apr 12, 2025 · 0 comments · May be fixed by #13194

Comments

@typed-sigterm
Copy link

Vue version

3.5.13

Link to minimal reproduction

https://play.vuejs.org/#eNp9kcFKxDAQhl8l5qRQWpbqpbQFlQX1oKKCl4CUdqxd0yQk01pY+u5OUnZdRb0l838z88/Mlp8bE48D8IznrradQSYr1RaCoxO8FAomoy2yWiuHrGIFWwmVJwtKMn1+pk2CMwc4GJKXtEvdG8o8PmFFyXJTXoGUOmLP2srmKE88+L0kQm9khUA/xvKQngToQOAR9aL6r10bb5xWNMHW44LXxHcS7J3BjvoLnrGgeK2izh83IYZ2gGgXr9+gfv8lvvHjZPS4t+DAjiD4XsPKtoCLvH68hYnee7HXzSCJ/kd8AKfl4D0u2MWgGrJ9wAW3172/QKfaJ7eeEJTbDeWNenIOvOB0Rr+qv0b/spvGpyFPqJm2+DKC9TVpgWl8Fq9SPn8CK16u/w==

Steps to reproduce

See the reproduction.

What is expected?

report Error: [@vue/compiler-sfc] <script> and <script setup> must have the same language type. rather than random errors.

What is actually happening?

it reports SyntaxError

System Info

System:
    OS: Windows 11 10.0.22631
    CPU: (6) x64 AMD Ryzen 5 4500U with Radeon Graphics
    Memory: 637.19 MB / 7.23 GB
  Binaries:
    Node: 22.13.1 - C:\nodejs\node.EXE
    Yarn: 1.22.22 - ~\AppData\Local\pnpm\yarn.CMD
    npm: 10.9.2 - C:\nodejs\npm.CMD
    pnpm: 10.7.0 - ~\AppData\Local\pnpm\pnpm.EXE
    bun: 1.2.7 - ~\.bun\bin\bun.EXE
  Browsers:
    Edge: Chromium (133.0.3065.92), ChromiumDev (136.0.3209.2)
    Internet Explorer: 11.0.22621.3527
  npmPackages:
    vue: ^3.5.13 => 3.5.13

Any additional comments?

No response

adrianbrs added a commit to adrianbrs/vuejs-core that referenced this issue Apr 13, 2025
…g babel

Previously, babel would throw a misleading error if <script> and <script setup> used different lang values. Now, the compiler checks for language mismatch first and throws a clear error before invoking babel

Close vuejs#13193
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants