sveltejs/kit · error

Cannot use reserved action name "default"

Error message

Cannot use reserved action name "default"

What it means

Form-action dispatch check in call_action: the action name is taken from a url search param starting with '/'; if that name is literally 'default' (?/default), it is rejected because 'default' is reserved for the unnamed action and cannot be explicitly addressed when named actions exist.

Source

Thrown at packages/kit/src/runtime/server/page/actions.js:229

		);
	}
}

/**
 * @param {RequestEvent} event
 * @param {import('types').RequestState} state
 * @param {NonNullable<ServerNode['actions']>} actions
 * @throws {Redirect | HttpError | SvelteKitError | Error}
 */
async function call_action(event, state, actions) {
	const url = new URL(event.request.url);

	let name = 'default';
	for (const param of url.searchParams) {
		if (param[0].startsWith('/')) {
			name = param[0].slice(1);
			if (name === 'default') {
				throw new Error('Cannot use reserved action name "default"');
			}
			break;
		}
	}

	if (!Object.hasOwn(actions, name)) {
		throw new SvelteKitError(404, 'Not Found', `No action with name '${name}' found`);
	}

	const action = actions[name];

	if (!is_form_content_type(event.request)) {
		throw new SvelteKitError(
			415,
			'Unsupported Media Type',
			`Form actions expect form-encoded data — received ${event.request.headers.get(
				'content-type'
			)}`

View on GitHub (pinned to 03f1687fe6)

Solutions

  1. Remove the /default query parameter to invoke the default action implicitly
  2. Rename the action to something other than 'default' and use ?/newname
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/kit/src/runtime/server/page/actions.js:229 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/ef9040604df74893. Report an issue: GitHub.