Skip to content

fix "Maximum call stack size exceeded" on resolveChildrens results.push.apply(results, result)#2543

Merged
ryansolid merged 3 commits into
solidjs:mainfrom
titoBouzout:main
May 14, 2026
Merged

fix "Maximum call stack size exceeded" on resolveChildrens results.push.apply(results, result)#2543
ryansolid merged 3 commits into
solidjs:mainfrom
titoBouzout:main

Conversation

@titoBouzout
Copy link
Copy Markdown
Contributor

@titoBouzout titoBouzout commented Sep 7, 2025

Summary

Related to #2542

What happens is that the children helper crashes when trying to results.push.apply(results, [149k items]), as it overflows the max amount of arguments a function can have.

Line

Array.isArray(result) ? results.push.apply(results, result) : results.push(result);

Now, if we want to fix this, I'm honestly not sure, considerations:

  1. if a component can return data, say an array with 200k items, then we want to fix it.
  2. for performance, I suppose (didn't measure), that checking for the length is negligible, (as in no performance impact)
  3. this fix probably helps to get something dirty done fast, to then be edited to do it the right way, say use something like TanStack Table or TanStack Virtual

Think point 1 gets me. If a component that can return data ends somehow being resolved by the children helper, then I suppose we should fix this.

Question: should also apply the edit to ? 🤔

Array.isArray(result) ? results.push.apply(results, result) : results.push(result);

How did you test this change?

Test passes, I also tested it by hacking the solution in vites output.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Sep 7, 2025

🦋 Changeset detected

Latest commit: d598b4b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
solid-js Patch
test-integration Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

titoBouzout and others added 2 commits April 29, 2026 14:33
Fixes an issue with 'Maximum call stack size exceeded' error in resolveChildren function.
@ryansolid ryansolid merged commit cf09fa0 into solidjs:main May 14, 2026
1 check passed
@coveralls
Copy link
Copy Markdown

Coverage Report for CI Build 25889426383

Warning

Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes.
Quick fix: rebase this PR. Learn more →

Coverage increased (+0.5%) to 85.888%

Details

  • Coverage increased (+0.5%) from the base build.
  • Patch coverage: 3 uncovered changes across 1 file (8 of 11 lines covered, 72.73%).
  • 3 coverage regressions across 2 files.

Uncovered Changes

File Changed Covered %
packages/solid/src/reactive/signal.ts 11 8 72.73%

Coverage Regressions

3 previously-covered lines in 2 files lost coverage.

File Lines Losing Coverage Coverage
packages/solid/store/src/store.ts 2 97.57%
packages/solid/src/reactive/scheduler.ts 1 80.39%

Coverage Stats

Coverage Status
Relevant Lines: 2709
Covered Lines: 2385
Line Coverage: 88.04%
Relevant Branches: 1153
Covered Branches: 932
Branch Coverage: 80.83%
Branches in Coverage %: Yes
Coverage Strength: 64.53 hits per line

💛 - Coveralls

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.

3 participants