{"record":{"id":"f04e3618ad184a13","repo":"sveltejs/kit","slug":"when-using-named-actions-the-default-action-canno","errorCode":null,"errorMessage":"When using named actions, the default action cannot be used. See the docs for more info: https://svelte.dev/docs/kit/form-actions#named-actions","messagePattern":"When using named actions, the default action cannot be used\\. See the docs for more info: https://svelte\\.dev/docs/kit/form-actions#named-actions","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/kit/src/runtime/server/page/actions.js","lineNumber":209,"sourceCode":"\t\t\t\tlocation,\n\t\t\t\t// @ts-expect-error this will be removed upon serialization, so `undefined` is the same as omission\n\t\t\t\tdata\n\t\t\t};\n\t\t}\n\t} catch (e) {\n\t\treturn action_error_result(\n\t\t\te instanceof ActionFailure ? new Error('Cannot \"throw fail()\". Use \"return fail()\"') : e,\n\t\t\tlocation\n\t\t);\n\t}\n}\n\n/**\n * @param {Actions} actions\n */\nfunction check_named_default_separate(actions) {\n\tif (actions.default && Object.keys(actions).length > 1) {\n\t\tthrow new Error(\n\t\t\t'When using named actions, the default action cannot be used. See the docs for more info: https://svelte.dev/docs/kit/form-actions#named-actions'\n\t\t);\n\t}\n}\n\n/**\n * @param {RequestEvent} event\n * @param {import('types').RequestState} state\n * @param {NonNullable<ServerNode['actions']>} actions\n * @throws {Redirect | HttpError | SvelteKitError | Error}\n */\nasync function call_action(event, state, actions) {\n\tconst url = new URL(event.request.url);\n\n\tlet name = 'default';\n\tfor (const param of url.searchParams) {\n\t\tif (param[0].startsWith('/')) {\n\t\t\tname = param[0].slice(1);","sourceCodeStart":191,"sourceCodeEnd":227,"githubUrl":"https://github.com/sveltejs/kit/blob/03f1687fe612ce3d2d9131139b5b188d9cf90c64/packages/kit/src/runtime/server/page/actions.js#L191-L227","documentation":"Form-action configuration check run before handling an action request: the +page.server.js actions object mixes a `default` action with named actions. With named actions present, the default action cannot be addressed (the ?/x query param selects named ones), so the combination is rejected to prevent unreachable code.","triggerScenarios":"Thrown at packages/kit/src/runtime/server/page/actions.js:209 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove the `default` action and give every action a name, invoking them via ?/action-name","Drop the named actions and keep only `default` if a single action suffices"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"03f1687fe612ce3d2d9131139b5b188d9cf90c64","analyzedAt":"2026-09-02T02:01:50.504Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}