Error codesAsync

An async value looks something up after an await

MARKLESS_ASYNC_POST_AWAIT_READerrorMarkless raises it while it builds your .tsrx files.

The message

MARKLESS_ASYNC_POST_AWAIT_READ: Cannot read "<source>" in async computed "<computedName>": the key "<awaitedSegment>" comes from awaited work, so the read cannot be part of the dependency key captured before the await.
Reads after an await join the dependency key, which is fixed before the await starts. This path is only known after the await, so the key could only hold the whole collection, and every write anywhere in it would rerun the awaited work.
Return what "<awaitedSegment>" comes from in this computed's result, and do the lookup "<source>" in a sync computed() that reads it.
https://markless.dev/errors/MARKLESS_ASYNC_POST_AWAIT_READ

Words in angle brackets change from case to case.

Why

Markless reads every state an async computed() names when it starts running, including reads after an await, and runs it again when one of them changes. A lookup whose key is the awaited answer, such as items[res.id], cannot be read before the answer arrives.

Fix

Return the answer from the async computed(). Do the lookup in a plain computed() that reads it.

const picked = computed(async ({ signal }) => loadPick(signal));const item = computed(() => items[picked.id]);
Where Markless raises it

All error codes