@sveltejs/kit
Version:
SvelteKit is the fastest way to build Svelte apps
181 lines (168 loc) • 7.39 kB
JavaScript
/* This file is generated by scripts/process-messages/index.js. Do not edit! */
import { DEV } from 'esm-env';
import { bold, normal } from './internal/shared.js';
/**
* `cache-control` header contains empty directives. (While parsing `%value%`.)
* @param {{ "value": string }} _values
*/
export function cache_control_empty_directive(_values) {
if (DEV) {
console.warn(
`%c[sveltekit] ${'cache_control_empty_directive'}\n%c${`\`cache-control\` header contains empty directives. (While parsing \`${_values.value}\`.)`}\nhttps://svelte.dev/e/kit/${'cache_control_empty_directive'}`,
bold,
normal
);
} else {
console.warn('https://svelte.dev/e/kit/cache_control_empty_directive');
}
}
/**
* Invalid `cache-control` directive `%directive%`. Did you mean one of: %directives%? (While parsing `%value%`.)
* @param {{ "directive": string; "directives": string; "value": string }} _values
*/
export function cache_control_invalid_directive(_values) {
if (DEV) {
console.warn(
`%c[sveltekit] ${'cache_control_invalid_directive'}\n%c${`Invalid \`cache-control\` directive \`${_values.directive}\`. Did you mean one of: ${_values.directives}? (While parsing \`${_values.value}\`.)`}\nhttps://svelte.dev/e/kit/${'cache_control_invalid_directive'}`,
bold,
normal
);
} else {
console.warn('https://svelte.dev/e/kit/cache_control_invalid_directive');
}
}
/**
* Invalid `content-type` value `%type%`. (While parsing `%value%`.)
* @param {{ "type": string; "value": string }} _values
*/
export function content_type_invalid(_values) {
if (DEV) {
console.warn(
`%c[sveltekit] ${'content_type_invalid'}\n%c${`Invalid \`content-type\` value \`${_values.type}\`. (While parsing \`${_values.value}\`.)`}\nhttps://svelte.dev/e/kit/${'content_type_invalid'}`,
bold,
normal
);
} else {
console.warn('https://svelte.dev/e/kit/content_type_invalid');
}
}
/**
* `%name%` cookie does not exist for `%pathname%`, but was previously set at %paths%. Did you mean to set its `path` to `'/'` instead?
* @param {{ "name": string; "pathname": string; "paths": string }} _values
*/
export function cookie_path_mismatch(_values) {
if (DEV) {
console.warn(
`%c[sveltekit] ${'cookie_path_mismatch'}\n%c${`\`${_values.name}\` cookie does not exist for \`${_values.pathname}\`, but was previously set at ${_values.paths}. Did you mean to set its \`path\` to \`'/'\` instead?`}\nhttps://svelte.dev/e/kit/${'cookie_path_mismatch'}`,
bold,
normal
);
} else {
console.warn('https://svelte.dev/e/kit/cookie_path_mismatch');
}
}
/**
* The form action returned a value, but it isn't available in `page.form`, because SSR is off. To handle the returned value in CSR, enhance your form with `use:enhance`. See https://svelte.dev/docs/kit/form-actions#progressive-enhancement-use-enhance
* @param {void} _values
*/
export function form_action_data_without_ssr(_values) {
if (DEV) {
console.warn(
`%c[sveltekit] ${'form_action_data_without_ssr'}\n%c${`The form action returned a value, but it isn't available in \`page.form\`, because SSR is off. To handle the returned value in CSR, enhance your form with \`use:enhance\`. See https://svelte.dev/docs/kit/form-actions#progressive-enhancement-use-enhance`}\nhttps://svelte.dev/e/kit/${'form_action_data_without_ssr'}`,
bold,
normal
);
} else {
console.warn('https://svelte.dev/e/kit/form_action_data_without_ssr');
}
}
/**
* The form action returned an error, but `+error.svelte` wasn't rendered because SSR is off. To get the error page with CSR, enhance your form with `use:enhance`. See https://svelte.dev/docs/kit/form-actions#progressive-enhancement-use-enhance
* @param {void} _values
*/
export function form_action_error_without_ssr(_values) {
if (DEV) {
console.warn(
`%c[sveltekit] ${'form_action_error_without_ssr'}\n%c${`The form action returned an error, but \`+error.svelte\` wasn't rendered because SSR is off. To get the error page with CSR, enhance your form with \`use:enhance\`. See https://svelte.dev/docs/kit/form-actions#progressive-enhancement-use-enhance`}\nhttps://svelte.dev/e/kit/${'form_action_error_without_ssr'}`,
bold,
normal
);
} else {
console.warn('https://svelte.dev/e/kit/form_action_error_without_ssr');
}
}
/**
* To use an async `handleError` hook to handle errors that occur during rendering, you must enable `compilerOptions.experimental.async` in the SvelteKit plugin of your Vite config. The returned error has been replaced with a generic object
* @param {void} _values
*/
export function handle_error_async_without_async_svelte(_values) {
if (DEV) {
console.warn(
`%c[sveltekit] ${'handle_error_async_without_async_svelte'}\n%c${`To use an async \`handleError\` hook to handle errors that occur during rendering, you must enable \`compilerOptions.experimental.async\` in the SvelteKit plugin of your Vite config. The returned error has been replaced with a generic object`}\nhttps://svelte.dev/e/kit/${'handle_error_async_without_async_svelte'}`,
bold,
normal
);
} else {
console.warn('https://svelte.dev/e/kit/handle_error_async_without_async_svelte');
}
}
/**
* `%id%`: %usage% in a promise handler after `load(...)` has returned will not cause the function to re-run when %change%
* @param {{ "id": string; "usage": string; "change": string }} _values
*/
export function load_tracking_after_return(_values) {
if (DEV) {
console.warn(
`%c[sveltekit] ${'load_tracking_after_return'}\n%c${`\`${_values.id}\`: ${_values.usage} in a promise handler after \`load(...)\` has returned will not cause the function to re-run when ${_values.change}`}\nhttps://svelte.dev/e/kit/${'load_tracking_after_return'}`,
bold,
normal
);
} else {
console.warn('https://svelte.dev/e/kit/load_tracking_after_return');
}
}
/**
* Avoid calling `fetch` eagerly during server-side rendering — put your `fetch` calls inside `onMount` or a `load` function instead
* @param {void} _values
*/
export function ssr_fetch_eager(_values) {
if (DEV) {
console.warn(
`%c[sveltekit] ${'ssr_fetch_eager'}\n%c${`Avoid calling \`fetch\` eagerly during server-side rendering — put your \`fetch\` calls inside \`onMount\` or a \`load\` function instead`}\nhttps://svelte.dev/e/kit/${'ssr_fetch_eager'}`,
bold,
normal
);
} else {
console.warn('https://svelte.dev/e/kit/ssr_fetch_eager');
}
}
/**
* Returning promises from server `load` functions will only work if `csr === true`
* @param {void} _values
*/
export function streaming_without_csr(_values) {
if (DEV) {
console.warn(
`%c[sveltekit] ${'streaming_without_csr'}\n%c${`Returning promises from server \`load\` functions will only work if \`csr === true\``}\nhttps://svelte.dev/e/kit/${'streaming_without_csr'}`,
bold,
normal
);
} else {
console.warn('https://svelte.dev/e/kit/streaming_without_csr');
}
}
/**
* Removing comments in `transformPageChunk` can break Svelte's hydration
* @param {void} _values
*/
export function transform_page_chunk_comments(_values) {
if (DEV) {
console.warn(
`%c[sveltekit] ${'transform_page_chunk_comments'}\n%c${`Removing comments in \`transformPageChunk\` can break Svelte's hydration`}\nhttps://svelte.dev/e/kit/${'transform_page_chunk_comments'}`,
bold,
normal
);
} else {
console.warn('https://svelte.dev/e/kit/transform_page_chunk_comments');
}
}