Skip to content

fix(compiler-sfc): return an empty block for vapor script setup without template - #16535

Merged
edison1105 merged 1 commit into
vuejs:minorfrom
ValentinYoushkevich:fix/vapor-script-setup-without-template
Dec 3, 2026
Merged

edison1105 merged 1 commit into
vuejs:minorfrom
ValentinYoushkevich:fix/vapor-script-setup-without-template

Conversation

@ValentinYoushkevich

Copy link
Copy Markdown
Contributor

A Vapor SFC with <script setup> and no <template> fails to build in production (inline template mode) with a syntax error, while the same file without vapor compiles fine. Script-only components show up in real code, e.g. uni-app root components that only register app hooks, like uni-plus's App.vue. Here's a playground in PROD mode.

Without a template, the inline branch emits () => {}, which Vapor's inline setup doesn't return, so it ends up as a bare expression after the setup code. Vapor now returns an empty block (return []), the same output as an empty <template>; SSR keeps () => {}.

@coderabbitai

coderabbitai Bot commented Dec 2, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3443defe-9b5e-4fdf-8564-950f71c69d5f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@pkg-pr-new

pkg-pr-new Bot commented Dec 2, 2026

Copy link
Copy Markdown

Open in StackBlitz

@vue/compiler-core

pnpm add https://pkg.pr.new/@vue/compiler-core@16535
npm i https://pkg.pr.new/@vue/compiler-core@16535
yarn add https://pkg.pr.new/@vue/compiler-core@16535.tgz

@vue/compiler-dom

pnpm add https://pkg.pr.new/@vue/compiler-dom@16535
npm i https://pkg.pr.new/@vue/compiler-dom@16535
yarn add https://pkg.pr.new/@vue/compiler-dom@16535.tgz

@vue/compiler-sfc

pnpm add https://pkg.pr.new/@vue/compiler-sfc@16535
npm i https://pkg.pr.new/@vue/compiler-sfc@16535
yarn add https://pkg.pr.new/@vue/compiler-sfc@16535.tgz

@vue/compiler-ssr

pnpm add https://pkg.pr.new/@vue/compiler-ssr@16535
npm i https://pkg.pr.new/@vue/compiler-ssr@16535
yarn add https://pkg.pr.new/@vue/compiler-ssr@16535.tgz

@vue/compiler-vapor

pnpm add https://pkg.pr.new/@vue/compiler-vapor@16535
npm i https://pkg.pr.new/@vue/compiler-vapor@16535
yarn add https://pkg.pr.new/@vue/compiler-vapor@16535.tgz

@vue/reactivity

pnpm add https://pkg.pr.new/@vue/reactivity@16535
npm i https://pkg.pr.new/@vue/reactivity@16535
yarn add https://pkg.pr.new/@vue/reactivity@16535.tgz

@vue/runtime-core

pnpm add https://pkg.pr.new/@vue/runtime-core@16535
npm i https://pkg.pr.new/@vue/runtime-core@16535
yarn add https://pkg.pr.new/@vue/runtime-core@16535.tgz

@vue/runtime-dom

pnpm add https://pkg.pr.new/@vue/runtime-dom@16535
npm i https://pkg.pr.new/@vue/runtime-dom@16535
yarn add https://pkg.pr.new/@vue/runtime-dom@16535.tgz

@vue/runtime-vapor

pnpm add https://pkg.pr.new/@vue/runtime-vapor@16535
npm i https://pkg.pr.new/@vue/runtime-vapor@16535
yarn add https://pkg.pr.new/@vue/runtime-vapor@16535.tgz

@vue/server-renderer

pnpm add https://pkg.pr.new/@vue/server-renderer@16535
npm i https://pkg.pr.new/@vue/server-renderer@16535
yarn add https://pkg.pr.new/@vue/server-renderer@16535.tgz

@vue/shared

pnpm add https://pkg.pr.new/@vue/shared@16535
npm i https://pkg.pr.new/@vue/shared@16535
yarn add https://pkg.pr.new/@vue/shared@16535.tgz

vue

pnpm add https://pkg.pr.new/vue@16535
npm i https://pkg.pr.new/vue@16535
yarn add https://pkg.pr.new/vue@16535.tgz

@vue/compat

pnpm add https://pkg.pr.new/@vue/compat@16535
npm i https://pkg.pr.new/@vue/compat@16535
yarn add https://pkg.pr.new/@vue/compat@16535.tgz

commit: fdcf706

@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown

Size Report

Bundles

File Size Gzip Brotli
compiler-dom.global.prod.js 87.5 kB 30.7 kB 27 kB
runtime-dom.global.prod.js 127 kB 47.4 kB 42.4 kB
vue.global.prod.js 187 kB 67.7 kB 60.2 kB

Usages

Name Size Gzip Brotli
createApp (CAPI only) 55.9 kB 21.7 kB 19.8 kB
createApp 65.5 kB 25.2 kB 22.9 kB
createApp + vaporInteropPlugin 127 kB 46.6 kB 41.8 kB
createVaporApp 37.2 kB 14.2 kB 13.1 kB
createSSRApp 70.4 kB 27.2 kB 24.7 kB
createVaporSSRApp 46 kB 17.5 kB 16.1 kB
defineCustomElement 72.1 kB 27.2 kB 24.7 kB
defineVaporCustomElement 52.3 kB 19.1 kB 17.5 kB
overall 82.7 kB 31.3 kB 28.3 kB

Apps

Name Size Gzip Brotli
counter app (CAPI only) 57.5 kB 22.3 kB 20.4 kB
counter vapor app (CAPI only) 47.5 kB 17.7 kB 16.2 kB
todo app (CAPI only) 73.9 kB 28.4 kB 25.8 kB
todo vapor app (CAPI only) 80.9 kB 29.8 kB 27.1 kB

@edison1105 edison1105 added the scope: vapor related to vapor mode label Dec 3, 2026
@edison1105
edison1105 merged commit fc1e326 into vuejs:minor Dec 3, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: vapor related to vapor mode

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants