MARKLESS_STATE_NESTED_CREATION
state() gets another state() call as its start value.
Error from the compiler, while it builds your .tsrx files.
What happened
The start value of state() must be plain data. Another state() call is not data.
Markless prints the message, the reason, and a suggestion:
MARKLESS_STATE_NESTED_CREATION: `<initSource>` declares graph state whose initial value is another state() call. `<name>` cannot store graph state as its value.
A graph cell serializes plain data across the resume boundary; a state() call declares a cell and has no serializable value form.
Before: `const x = state(state(5));` — After: `const x = state(5);`.
https://markless.dev/errors/MARKLESS_STATE_NESTED_CREATION
Words in angle brackets change from case to case.
How to fix it
Pass the plain start value.
const x = state(5);
Where it comes from
@markless/compiler raises this code. Source:
Read how to read a Markless error, or go back to all error codes.
