unguarded-async-lifecycle
This fails the run. Where it is wrong about your code, // ramonda-check-ignore <reason> on the line says so, and the reason is printed on every run.
Reported when an async lifecycle awaits something with no try or .catch to handle a failure.
The framework reports the same fault while running, as RMD059 — but only once the line actually runs. This is the same fault proved from the source instead.
An error boundary does not see a rejection from a lifecycle, and that is deliberate: it arrives at an arbitrary later moment, when the page is already interactive and there is no render left to fail. Replacing the page with a fallback then is the worse outcome.
What follows is why this is worth reporting. The page renders as though the method
succeeded — the fetch that failed just left its @state at the initial value — and the only
trace is an unhandled rejection in a console nobody is watching.
So catch it where it happens and put the failure in @state, which is the only way to tell
the reader anything:
@state error = "";
@mounted async load() {
try { this.posts = await fetchPosts(); }
catch (e) { this.error = String(e); }
}
If the failure really should take the page down, re-throw it from render() — that IS a
render, and a boundary can see it.
A method that never awaits is not reported: it can only throw synchronously, and the
lifecycle runner catches that. Any try or .catch in the body is taken as handling it.
Next
- All rules — the other checks this one runs beside.
- Checking your app — how to run it, and what it proves.