sveltejs/kit · error · Error
incorrect_fail_message (form action returned an ActionFailur
Error message
incorrect_fail_message (form action returned an ActionFailure from a remote form function, dev-only)
What it means
Dev-only diagnostic inside remote form handling: after invoking the remote form function, its return value was an ActionFailure. Remote form functions replaced classic form actions and must surface invalid state via the provided `issue` callback (create_issues), not by returning or throwing fail(); this guard replaces the opaque failure with the shared incorrect_fail_message so the developer sees the real mistake.
Source
Thrown at packages/kit/src/runtime/app/server/remote/form.js:127
handle_issues(output, validated.issues, form_data, __.id);
} else {
if (validated !== undefined) {
data = validated.value;
}
const issue = create_issues();
try {
output.result = await run_remote_function(
event,
state,
true,
() => data,
(data) => (!maybe_fn ? fn() : fn(data, issue))
);
if (DEV && output.result instanceof ActionFailure) {
throw new Error(incorrect_fail_message);
}
} catch (e) {
if (e instanceof ValidationError) {
handle_issues(output, e.issues, form_data, __.id);
} else if (DEV && e instanceof ActionFailure) {
throw new Error(incorrect_fail_message, { cause: e });
} else {
throw e;
}
}
}
// We don't need to care about args or deduplicating calls, because uneval results are only relevant in full page reloads
// where only one form submission is active at the same time
if (!event.isRemoteRequest) {
const cache = get_cache(__, state);
cache[''] ??= output;
View on GitHub (pinned to 03f1687fe6)
Solutions
- Replace `return fail(...)` with the issue callback passed to the form function, e.g. issue('field', 'message')
- Return normal data from the remote form function and report validation problems via create_issues
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at packages/kit/src/runtime/app/server/remote/form.js:127 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of sveltejs/kit@03f1687fe6 (2026-09-02).
Data as JSON: /api/errors/cb01c42a74bfa5bd.
Report an issue: GitHub.