Version
3.5.35
Reproduction link
play.vuejs.org/
Steps to reproduce
Open the playground link; it throws on load.
The trigger is v-memo + dynamic :key on a plain element without v-for, where the key references a prop
What is expected?
:key expression is prefixed like any other (__props.updateKey / _ctx.updateKey), as in ≤3.5.12
What is actually happening?
transformExpression skips the :key expression whenever the element has v-memo (the !(memo && arg.content === 'key') check added in 99009ee / PR #12014), assuming transformFor processed it eagerly — but that only happens when v-for is also present.
Plain elements fall through → unprefixed key → ReferenceError at runtime
This happened after vue version update.
We hit this in a component library's scroll-container component. It renders custom scrollbars, so its reactive scroll state changes on every scroll frame; to keep large slotted content (e.g. a table body with thousands of cells) from re-rendering on each frame, the content wrapper uses v-memo="[updateKey]" with :key="updateKey" on the same element — "freeze this subtree, and when the parent bumps updateKey (data reload, layout change), rebuild it from scratch instead of diffing."
This compiled and ran correctly up to compiler 3.5.12; from 3.5.13 the generated render function references the key as a bare identifier and every page using the component throws ReferenceError on first render.
Current workaround: v-bind="{ key: updateKey }" instead of :key="updateKey", which bypasses the skipped code path and produces a correctly prefixed expression.
Version
3.5.35
Reproduction link
play.vuejs.org/
Steps to reproduce
Open the playground link; it throws on load.
The trigger is v-memo + dynamic :key on a plain element without v-for, where the key references a prop
What is expected?
:key expression is prefixed like any other (__props.updateKey / _ctx.updateKey), as in ≤3.5.12
What is actually happening?
transformExpression skips the :key expression whenever the element has v-memo (the !(memo && arg.content === 'key') check added in 99009ee / PR #12014), assuming transformFor processed it eagerly — but that only happens when v-for is also present.
Plain elements fall through → unprefixed key → ReferenceError at runtime
This happened after vue version update.
We hit this in a component library's scroll-container component. It renders custom scrollbars, so its reactive scroll state changes on every scroll frame; to keep large slotted content (e.g. a table body with thousands of cells) from re-rendering on each frame, the content wrapper uses v-memo="[updateKey]" with :key="updateKey" on the same element — "freeze this subtree, and when the parent bumps updateKey (data reload, layout change), rebuild it from scratch instead of diffing."
This compiled and ran correctly up to compiler 3.5.12; from 3.5.13 the generated render function references the key as a bare identifier and every page using the component throws ReferenceError on first render.
Current workaround: v-bind="{ key: updateKey }" instead of :key="updateKey", which bypasses the skipped code path and produces a correctly prefixed expression.