Skip to content

fix: give the Vue parity check's Node render enough stack for deep pages - #408

Merged
JuroOravec merged 1 commit into
mainfrom
fix/parity-node-stack
Oct 25, 2026
Merged

JuroOravec merged 1 commit into
mainfrom
fix/parity-node-stack

Conversation

@JuroOravec

Copy link
Copy Markdown
Member

The Vue render parity check reported RangeError: Maximum call stack size exceeded for two pages that #400's hydration tests record: test_deep_templates_are_written_whole_on_the_server[c-for attributes] and test_a_deep_template_renders_on_a_thread_with_a_small_stack. Another lane hit it on a branch with no Vue changes.

Why

The check renders each page with Vue's own renderToString in Node. Vue's server renderer calls itself several times per nested element, and V8 stops at about 984 KB of stack by default. A template at the nesting limits planned in #272 needs more.

Is the browser affected?

No. In headless Chrome, Vue mounted the same trees, built with render functions as the compiled templates build them:

  • 400 and 512 nested elements;
  • 256 <template v-for> levels around 144 and 256 elements.

All rendered the value. So the server is right to write those pages whole; only the check needed more stack.

The change

scripts/vue_render_parity/check.py starts Node with --stack-size=4000 (KB). That stays well inside the 8 MB main-thread stack of macOS and of GitHub's Linux runners; V8 crashes instead of raising when the flag asks for more than the thread has. A comment in the script says why.

Checks

The parity check over the deep hydration tests now reports 0 mismatches and 0 Vue errors, where it reported 2 Vue errors.

🤖 Generated with Claude Code

The parity check renders each recorded page with Vue's server renderer
in Node. Since #400, the hydration tests record pages at the nesting
limits planned in #272, and for two of them, `c-for attributes` and the
512 KiB thread test, Vue's `renderToString` raised `RangeError: Maximum
call stack size exceeded`. Vue's server renderer calls itself several
times per nested element, and V8 stops at about 984 KB of stack by
default.

A browser mounts the same trees: in headless Chrome, Vue mounted 512
nested elements and 256 `v-for` levels around 256 elements, the same
shapes built with render functions. So the server is right to write
those pages whole, and only the check needs more stack. It now starts
Node with `--stack-size=4000` (KB), which stays well inside the 8 MB
main-thread stack of macOS and of GitHub's Linux runners; V8 crashes
instead of raising when the flag asks for more than the thread has.

The parity check over the deep hydration tests now reports 0 Vue
errors, where it reported 2.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@JuroOravec
JuroOravec merged commit ac30617 into main Oct 25, 2026
5 of 6 checks passed
@JuroOravec
JuroOravec deleted the fix/parity-node-stack branch October 25, 2026 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant