MARKLESS_EVENT_HANDLER_EMIT_UNSUPPORTED
An event handler reads a local variable that does not exist in the browser.
Error from the compiler, while it builds your .tsrx files.
What happened
The handler reads a plain local from the component body. The browser does not run the component body again, so that local does not exist when the click happens.
Markless prints the message, the reason, and a suggestion:
MARKLESS_EVENT_HANDLER_EMIT_UNSUPPORTED: Cannot emit lazy <kind> symbol "<symbolId>" because it reads component-local "<name>", a local <bindingKindLabel> value that cannot cross a resume boundary.
Lazy handler symbols run after browser resume. Handler bodies may use graph references, element handles, props/shared values, module imports, or serializable capture-plane inputs; unsupported body locals would otherwise become silent no-op code.
https://markless.dev/errors/MARKLESS_EVENT_HANDLER_EMIT_UNSUPPORTED
Words in angle brackets change from case to case.
How to fix it
Make the local state(). Or move it to the top of the file. Or build it only from props, state, and imports.
Where it comes from
@markless/compiler raises this code. Source:
Read how to read a Markless error, or go back to all error codes.
