Skip to content

fix(compiler-sfc): throw mismatched script langs error before invoking babel (fix #13193) #13194

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
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

adrianbrs
Copy link

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 #13193

Before:
image

After:
image

…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
Copy link

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 100 kB 38.1 kB 34.4 kB
vue.global.prod.js 158 kB 58.3 kB 51.9 kB

Usages

Name Size Gzip Brotli
createApp (CAPI only) 46.4 kB 18.1 kB 16.6 kB
createApp 54.4 kB 21.2 kB 19.4 kB
createSSRApp 58.6 kB 22.9 kB 20.9 kB
defineCustomElement 59.2 kB 22.7 kB 20.7 kB
overall 68.5 kB 26.3 kB 24 kB

Copy link

pkg-pr-new bot commented Apr 14, 2025

Open in StackBlitz

@vue/compiler-core

npm i https://pkg.pr.new/@vue/compiler-core@13194

@vue/compiler-dom

npm i https://pkg.pr.new/@vue/compiler-dom@13194

@vue/compiler-ssr

npm i https://pkg.pr.new/@vue/compiler-ssr@13194

@vue/compiler-sfc

npm i https://pkg.pr.new/@vue/compiler-sfc@13194

@vue/reactivity

npm i https://pkg.pr.new/@vue/reactivity@13194

@vue/runtime-core

npm i https://pkg.pr.new/@vue/runtime-core@13194

@vue/runtime-dom

npm i https://pkg.pr.new/@vue/runtime-dom@13194

@vue/server-renderer

npm i https://pkg.pr.new/@vue/server-renderer@13194

@vue/shared

npm i https://pkg.pr.new/@vue/shared@13194

vue

npm i https://pkg.pr.new/vue@13194

@vue/compat

npm i https://pkg.pr.new/@vue/compat@13194

commit: 755ce70

@edison1105 edison1105 added ready to merge The PR is ready to be merged. scope: compiler 🍰 p2-nice-to-have Priority 2: this is not breaking anything but nice to have it addressed. labels Apr 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍰 p2-nice-to-have Priority 2: this is not breaking anything but nice to have it addressed. ready to merge The PR is ready to be merged. scope: compiler
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect error message when <script> <script setup> has different languages
2 participants