Skip to content

fix(runtime-vapor): do not crash hydrating a null value binding - #15541

Merged
edison1105 merged 1 commit into
vuejs:minorfrom
ValentinYoushkevich:fix/vapor-hydrate-null-value
Sep 16, 2026
Merged

edison1105 merged 1 commit into
vuejs:minorfrom
ValentinYoushkevich:fix/vapor-hydrate-null-value

Conversation

@ValentinYoushkevich

Copy link
Copy Markdown
Contributor

When SSR output is hydrated, a value binding that resolves to null or undefined crashes the app:

<select>
  <option :value="data">hello</option>
</select>

app.mount() throws TypeError: Cannot read properties of null (reading '0') and bails out, leaving the container empty — the server-rendered markup is discarded instead of being hydrated. Same for <input :value> and <textarea :value>. Only in dev, or in production with __FEATURE_PROD_HYDRATION_MISMATCH_DETAILS__ enabled.

The hydration mismatch check in setValue passes the raw binding to getClientText, which indexes into it (value[0]) to strip a leading newline for <pre>/<textarea>. That assumes a string. VDOM handles the same case explicitly — getAttributeMismatch has a dedicated clientValue == null branch and hydrates normally.

Now non-string values are handed to the mismatch check directly, skipping the newline normalization that only makes sense for strings.

getClientText indexes into the value string, so a null or undefined
:value on option/input/textarea threw during the mismatch check and
aborted the whole hydration.
@coderabbitai

coderabbitai Bot commented Sep 16, 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

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: da6186e8-797a-4901-a814-ebb465170c9b

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

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

Comment @coderabbitai help to get the list of available commands.

@pkg-pr-new

pkg-pr-new Bot commented Sep 16, 2026

Copy link
Copy Markdown

Open in StackBlitz

@vue/compiler-core

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

@vue/compiler-dom

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

@vue/compiler-sfc

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

@vue/compiler-ssr

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

@vue/compiler-vapor

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

@vue/reactivity

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

@vue/runtime-core

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

@vue/runtime-dom

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

@vue/runtime-vapor

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

@vue/server-renderer

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

@vue/shared

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

vue

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

@vue/compat

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

commit: 4d2c464

@github-actions

Copy link
Copy Markdown

Size Report

Bundles

File Size Gzip Brotli
compiler-dom.global.prod.js 87.2 kB (-272 B) 30.6 kB (-40 B) 26.9 kB (-60 B)
runtime-dom.global.prod.js 116 kB (+744 B) 43.7 kB (+235 B) 39.1 kB (+134 B)
vue.global.prod.js 176 kB (+476 B) 63.9 kB (+217 B) 56.8 kB (+116 B)

Usages

Name Size Gzip Brotli
createApp (CAPI only) 53.2 kB (+530 B) 20.6 kB (+117 B) 18.8 kB (+125 B)
createApp 61.9 kB (+238 B) 23.8 kB (-5 B) 21.7 kB (-25 B)
createApp + vaporInteropPlugin 120 kB (+4.55 kB) 43.3 kB (+1.66 kB) 39 kB (+1.61 kB)
createVaporApp 30.7 kB (+1.38 kB) 11.8 kB (+373 B) 10.8 kB (+357 B)
createSSRApp 67.1 kB (+363 B) 25.9 kB (+27 B) 23.5 kB (+61 B)
createVaporSSRApp 37 kB (+2.43 kB) 14.1 kB (+773 B) 12.9 kB (+737 B)
defineCustomElement 68.5 kB (+101 B) 25.8 kB (-51 B) 23.5 kB (-62 B)
defineVaporCustomElement 46.1 kB (+927 B) 16.8 kB (+259 B) 15.4 kB (+220 B)
overall 77.3 kB (+315 B) 29.4 kB (+44 B) 26.6 kB (-26 B)

@edison1105 edison1105 added the scope: vapor related to vapor mode label Sep 16, 2026
@edison1105
edison1105 merged commit 9f93220 into vuejs:minor Sep 16, 2026
15 checks passed
@ValentinYoushkevich
ValentinYoushkevich deleted the fix/vapor-hydrate-null-value branch September 17, 2026 04:43
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