UNPKG

@sveltejs/kit

Version:

SvelteKit is the fastest way to build Svelte apps

278 lines (234 loc) • 9.8 kB
/* This file is generated by scripts/process-messages/index.js. Do not edit! */ import { DEV } from 'esm-env'; import { throw_error } from './internal/shared.js'; /** * Your form contains `<input type="file">` fields, but is missing the necessary `enctype="multipart/form-data"` attribute * @param {void} _values * @returns {never} */ export function enhance_file_without_enctype(_values) { if (DEV) { throw_error('enhance_file_without_enctype', `Your form contains \`<input type="file">\` fields, but is missing the necessary \`enctype="multipart/form-data"\` attribute`, enhance_file_without_enctype); } throw new Error('https://svelte.dev/e/kit/enhance_file_without_enctype'); } /** * `use:enhance` can only be used on `<form>` elements with `method="POST"` * @param {void} _values * @returns {never} */ export function enhance_invalid_method(_values) { if (DEV) { throw_error('enhance_invalid_method', `\`use:enhance\` can only be used on \`<form>\` elements with \`method="POST"\``, enhance_invalid_method); } throw new Error('https://svelte.dev/e/kit/enhance_invalid_method'); } /** * The `goto(..., { noScroll: true, keepFocus: true })` options have been replaced by `reset: false` * @param {void} _values * @returns {never} */ export function goto_options_removed(_values) { if (DEV) { throw_error('goto_options_removed', `The \`goto(..., { noScroll: true, keepFocus: true })\` options have been replaced by \`reset: false\``, goto_options_removed); } throw new Error('https://svelte.dev/e/kit/goto_options_removed'); } /** * Cannot call `%caller%(...)` before router is initialized * @param {{ "caller": string }} _values * @returns {never} */ export function navigation_before_start(_values) { if (DEV) { throw_error('navigation_before_start', `Cannot call \`${_values.caller}(...)\` before router is initialized`, navigation_before_start); } throw new Error('https://svelte.dev/e/kit/navigation_before_start'); } /** * Cannot use `%caller%` with an external URL. Use `window.location = "%url%"` instead * @param {{ "caller": string; "url": string }} _values * @returns {never} */ export function navigation_external_url(_values) { if (DEV) { throw_error('navigation_external_url', `Cannot use \`${_values.caller}\` with an external URL. Use \`window.location = "${_values.url}"\` instead`, navigation_external_url); } throw new Error('https://svelte.dev/e/kit/navigation_external_url'); } /** * Cannot use `%caller%` with a URL that does not resolve to a route within the app. Use `window.location = "%url%"` instead * @param {{ "caller": string; "url": string }} _values * @returns {never} */ export function navigation_route_missing(_values) { if (DEV) { throw_error('navigation_route_missing', `Cannot use \`${_values.caller}\` with a URL that does not resolve to a route within the app. Use \`window.location = "${_values.url}"\` instead`, navigation_route_missing); } throw new Error('https://svelte.dev/e/kit/navigation_route_missing'); } /** * `preloadCode` expects a route ID starting with `/` (such as `/blog/[slug]`), but received `%id%` * @param {{ "id": string }} _values * @returns {never} */ export function preload_invalid_route_id(_values) { if (DEV) { throw_error('preload_invalid_route_id', `\`preloadCode\` expects a route ID starting with \`/\` (such as \`/blog/[slug]\`), but received \`${_values.id}\``, preload_invalid_route_id); } throw new Error('https://svelte.dev/e/kit/preload_invalid_route_id'); } /** * Attempted to preload a URL that does not belong to this app: `%url%` * @param {{ "url": string }} _values * @returns {never} */ export function preload_url_outside_app(_values) { if (DEV) { throw_error('preload_url_outside_app', `Attempted to preload a URL that does not belong to this app: \`${_values.url}\``, preload_url_outside_app); } throw new Error('https://svelte.dev/e/kit/preload_url_outside_app'); } /** * Redirect loop while navigating to `%url%` * @param {{ "url": string }} _values * @returns {never} */ export function redirect_loop(_values) { if (DEV) { throw_error('redirect_loop', `Redirect loop while navigating to \`${_values.url}\``, redirect_loop); } throw new Error('https://svelte.dev/e/kit/redirect_loop'); } /** * Redirects are not allowed in commands. Return a result instead and use `goto` on the client * @param {void} _values * @returns {never} */ export function remote_command_redirect(_values) { if (DEV) { throw_error('remote_command_redirect', `Redirects are not allowed in commands. Return a result instead and use \`goto\` on the client`, remote_command_redirect); } throw new Error('https://svelte.dev/e/kit/remote_command_redirect'); } /** * Cannot mix and match file and non-file inputs under the same name (`%name%`) * @param {{ "name": string }} _values * @returns {never} */ export function remote_form_mixed_inputs(_values) { if (DEV) { throw_error('remote_form_mixed_inputs', `Cannot mix and match file and non-file inputs under the same name (\`${_values.name}\`)`, remote_form_mixed_inputs); } throw new Error('https://svelte.dev/e/kit/remote_form_mixed_inputs'); } /** * A form object can only be attached to a single `<form>` element * @param {void} _values * @returns {never} */ export function remote_form_multiple_elements(_values) { if (DEV) { throw_error('remote_form_multiple_elements', `A form object can only be attached to a single \`<form>\` element`, remote_form_multiple_elements); } throw new Error('https://svelte.dev/e/kit/remote_form_multiple_elements'); } /** * Can only use the `multiple` attribute when `name` includes a `[]` suffix — consider changing `%name%` to `%name%[]` * @param {{ "name": string }} _values * @returns {never} */ export function remote_form_multiple_files(_values) { if (DEV) { throw_error('remote_form_multiple_files', `Can only use the \`multiple\` attribute when \`name\` includes a \`[]\` suffix — consider changing \`${_values.name}\` to \`${_values.name}[]\``, remote_form_multiple_files); } throw new Error('https://svelte.dev/e/kit/remote_form_multiple_files'); } /** * Cannot call `submit()` before the form is attached * @param {void} _values * @returns {never} */ export function remote_form_not_attached(_values) { if (DEV) { throw_error('remote_form_not_attached', `Cannot call \`submit()\` before the form is attached`, remote_form_not_attached); } throw new Error('https://svelte.dev/e/kit/remote_form_not_attached'); } /** * `$` is used to collect all FormData validation issues and cannot be used as the `name` of a form control * @param {void} _values * @returns {never} */ export function remote_form_reserved_field(_values) { if (DEV) { throw_error('remote_form_reserved_field', `\`$\` is used to collect all FormData validation issues and cannot be used as the \`name\` of a form control`, remote_form_reserved_field); } throw new Error('https://svelte.dev/e/kit/remote_form_reserved_field'); } /** * Multiple overrides for the same query are not allowed in a single `updates()` invocation * @param {void} _values * @returns {never} */ export function remote_updates_duplicate_override(_values) { if (DEV) { throw_error('remote_updates_duplicate_override', `Multiple overrides for the same query are not allowed in a single \`updates()\` invocation`, remote_updates_duplicate_override); } throw new Error('https://svelte.dev/e/kit/remote_updates_duplicate_override'); } /** * `updates()` expects a query or live query function, query resource, or query override * @param {void} _values * @returns {never} */ export function remote_updates_invalid_argument(_values) { if (DEV) { throw_error('remote_updates_invalid_argument', `\`updates()\` expects a query or live query function, query resource, or query override`, remote_updates_invalid_argument); } throw new Error('https://svelte.dev/e/kit/remote_updates_invalid_argument'); } /** * Cannot use reserved query parameter `%key%` * @param {{ "key": string }} _values * @returns {never} */ export function reserved_query_parameter(_values) { if (DEV) { throw_error('reserved_query_parameter', `Cannot use reserved query parameter \`${_values.key}\``, reserved_query_parameter); } throw new Error('https://svelte.dev/e/kit/reserved_query_parameter'); } /** * Can only disable scroll handling during navigation * @param {void} _values * @returns {never} */ export function scroll_handling_outside_navigation(_values) { if (DEV) { throw_error('scroll_handling_outside_navigation', `Can only disable scroll handling during navigation`, scroll_handling_outside_navigation); } throw new Error('https://svelte.dev/e/kit/scroll_handling_outside_navigation'); } /** * `snapshot()` was called multiple times from the same call site. Pass a unique `id` to distinguish the instances. * @param {void | { "id": string }} _values * @returns {never} */ export function snapshot_duplicate_id(_values) { if (DEV) { throw_error('snapshot_duplicate_id', (_values?.id !== undefined ? `A snapshot with id \`${_values.id}\` is already registered. Pass a unique \`id\`.` : `\`snapshot()\` was called multiple times from the same call site. Pass a unique \`id\` to distinguish the instances.`), snapshot_duplicate_id); } throw new Error('https://svelte.dev/e/kit/snapshot_duplicate_id'); } /** * Could not generate a snapshot id from the stack trace. Pass an `id` instead. * @param {void} _values * @returns {never} */ export function snapshot_id_missing(_values) { if (DEV) { throw_error('snapshot_id_missing', `Could not generate a snapshot id from the stack trace. Pass an \`id\` instead.`, snapshot_id_missing); } throw new Error('https://svelte.dev/e/kit/snapshot_id_missing'); }