MARKLESS_ASYNC_POST_AWAIT_READ
An async computed() reads state after an await.
Error from the compiler, while it builds your .tsrx files.
What happened
Markless records which state an async computed() reads before its first await. A read after the await is invisible to it.
Markless prints the message, the reason, and a suggestion:
MARKLESS_ASYNC_POST_AWAIT_READ: Cannot read "<source>" after await in async computed "<computedName>". Snapshot the value before awaiting.
Async computed dependency keys are captured before the first await. Reading graph state after suspension would make revalidation and resume depend on hidden async timing.
Read the graph value before the first await, or split post-await formatting into a separate sync computed().
https://markless.dev/errors/MARKLESS_ASYNC_POST_AWAIT_READ
Words in angle brackets change from case to case.
How to fix it
Copy the value into a local before the first await. Use the local after it.
const details = computed(async ({ signal }) => {
const q = name;
return { title: await loadGreeting(q, signal) };
});
Where it comes from
@markless/compiler raises this code. Source:
Read how to read a Markless error, or go back to all error codes.
