Description
Describe the bug
Conditions:
- The memo should be
lazy. - The expression should be conditional.
[memo().a, memo().b]works normally. - The memo should be read in both side(condition and conditionally evaluated value) of the expression.
Then the memo gets recomputed automatically when the compute function yielded a value, leading to infinite loading.
The document for createMemo says:
lazy—boolean
When true, defers the initial computation until the value is first read, and opts the memo into autodisposal — once it has no remaining subscribers it is torn down and recomputed from scratch on the next read.
My naive guess is that the memo gets disposed before the conditionally evaluated value subscribes the memo so recomputation occurs.
Your Example Website or App
https://solid2.netlify.app/#solidjs-repl:SRn7SNNPTRCRKF9GzAEvTg
Steps to Reproduce the Bug or Issue
- Open the playground.
- Check the checkbox to start computation.
- See console, messages keep logging.
Expected behavior
The memo should not be computed again unless either it is completely unused or any of its dependencies is changed.
Screenshots or Videos
v.mp4
Platform
- OS: Windows
- Browser: Chrome 155.0.8059.40
- Solid: 2.0.0 rc.14 and rc.15
Additional context
It seems the problem exists since @solidjs/signals@2.0.0-rc.14.
Activity
chore(size): raise caps for the #4142 lazy-memo release fix
fix(signals): a lazy memo read only through a rebuilt child memo is n…
ryansolid commentedon Oct 19, 2026
Generated by Claude Code