Skip to content

fix(runtime-vapor): hydrate vdom slot content of a vapor <slot /> root - #16375

Merged
edison1105 merged 1 commit into
vuejs:minorfrom
jrandolf:fix/vapor-slot-root-hydration
Nov 23, 2026
Merged

edison1105 merged 1 commit into
vuejs:minorfrom
jrandolf:fix/vapor-slot-root-hydration

Conversation

@jrandolf

Copy link
Copy Markdown
Contributor

Follow-up to #16330.

In a vdom app, a vapor component whose root is <slot /> warns on hydration when its slot content has a vapor component:

<!-- App.vue (vdom) -->
<Provider><Child /></Provider>

<!-- Provider.vue (vapor) -->
<slot />
[Vue warn]: Hydration node mismatch:
- rendered on server: <!--[--> (start of fragment)
- expected on client: more root nodes
  at <Provider>

Hydration then puts a new <!--{-->…<!--}--> range around the server range of Provider.

Cause. The vdom slot content hydrates in a hydrateNode pass. Child locates its start node before it enters its own range. That read runs the root check of #16330 for Provider at the same block depth, so the check reads Child as a second root of Provider.

Fix. A hydrateNode pass counts as a nested block (blockDepth), as the block fns of vapor slot content do. A component that enters its range in the pass still gets the check for its own roots.

Test. A vdom app with a vapor <slot /> root and a vapor component in its slot content.

A vapor component that vdom slot content renders locates its start node
before it enters its own range. In a vapor component whose root is
`<slot />`, that read was taken as a second root of the slot's component.
A `hydrateNode` pass now counts as a nested block.
@coderabbitai

coderabbitai Bot commented Nov 20, 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: 7bb388f3-8c80-45fe-a4ed-8d3bd0e26077

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 Nov 20, 2026

Copy link
Copy Markdown

Open in StackBlitz

@vue/compiler-core

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

@vue/compiler-dom

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

@vue/compiler-sfc

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

@vue/compiler-ssr

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

@vue/compiler-vapor

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

@vue/reactivity

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

@vue/runtime-core

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

@vue/runtime-dom

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

@vue/runtime-vapor

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

@vue/server-renderer

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

@vue/shared

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

vue

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

@vue/compat

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

commit: 3f902c3

@github-actions

Copy link
Copy Markdown

Size Report

Bundles

File Size Gzip Brotli
compiler-dom.global.prod.js 87.5 kB 30.7 kB 26.9 kB
runtime-dom.global.prod.js 125 kB 47 kB 42 kB
vue.global.prod.js 186 kB 67.2 kB 59.8 kB

Usages

Name Size Gzip Brotli
createApp (CAPI only) 55.7 kB 21.7 kB 19.8 kB
createApp 65 kB 25.1 kB 22.8 kB
createApp + vaporInteropPlugin 126 kB 46.1 kB 41.4 kB
createVaporApp 36.1 kB 13.9 kB 12.7 kB
createSSRApp 69.9 kB 27.1 kB 24.6 kB
createVaporSSRApp 44.4 kB 16.9 kB 15.5 kB
defineCustomElement 71.5 kB 27.1 kB 24.5 kB
defineVaporCustomElement 51.2 kB 18.7 kB 17.2 kB
overall 82.2 kB 31.1 kB 28.1 kB

@edison1105 edison1105 added the scope: vapor related to vapor mode label Nov 23, 2026
@edison1105
edison1105 merged commit 836f13b into vuejs:minor Nov 23, 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