UNPKG

astro

Version:

Astro is a modern site builder with web best practices, performance, and DX front-of-mind.

2,064 lines • 94.9 kB
/**
* @docs
* @kind heading
* @name Astro Errors
*/
// Astro Errors, most errors will go here!
/**
* @docs
* @message
* Unknown compiler error.
* @see
* - [withastro/compiler issues list](https://astro.build/issues/compiler)
* @description
* Astro encountered an unknown error while compiling your files. In most cases, this is not your fault, but an issue in our compiler.
*
* If there isn't one already, please [create an issue](https://astro.build/issues/compiler).
*/
export const UnknownCompilerError = {
	name: "UnknownCompilerError",
	title: "Unknown compiler error.",
	hint: "This is almost always a problem with the Astro compiler, not your code. Please open an issue at https://astro.build/issues/compiler."
};
/**
* @docs
* @see
* - [Official integrations](https://docs.astro.build/en/guides/integrations/#official-integrations)
* - [`Astro.clientAddress`](https://docs.astro.build/en/reference/api-reference/#clientaddress)
* @description
* The adapter you're using unfortunately does not support `Astro.clientAddress`.
*/
export const ClientAddressNotAvailable = {
	name: "ClientAddressNotAvailable",
	title: "`Astro.clientAddress` is not available in current adapter.",
	message: (adapterName) => `\`Astro.clientAddress\` is not available in the \`${adapterName}\` adapter. File an issue with the adapter to add support.`
};
/**
* @docs
* @see
* - [On-demand rendering](https://docs.astro.build/en/guides/on-demand-rendering/)
* - [`Astro.clientAddress`](https://docs.astro.build/en/reference/api-reference/#clientaddress)
* @description
* The `Astro.clientAddress` property cannot be used inside prerendered routes.
*/
export const PrerenderClientAddressNotAvailable = {
	name: "PrerenderClientAddressNotAvailable",
	title: "`Astro.clientAddress` cannot be used inside prerendered routes.",
	message: (name) => `\`Astro.clientAddress\` cannot be used inside prerendered route ${name}.`
};
/**
* @docs
* @see
* - [Enabling SSR in Your Project](https://docs.astro.build/en/guides/on-demand-rendering/)
* - [`Astro.clientAddress`](https://docs.astro.build/en/reference/api-reference/#clientaddress)
* @description
* The `Astro.clientAddress` property is only available when [Server-side rendering](https://docs.astro.build/en/guides/on-demand-rendering/) is enabled.
*
* To get the user's IP address in static mode, different APIs such as [Ipify](https://www.ipify.org/) can be used in a [Client-side script](https://docs.astro.build/en/guides/client-side-scripts/) or it may be possible to get the user's IP using a serverless function hosted on your hosting provider.
*/
export const StaticClientAddressNotAvailable = {
	name: "StaticClientAddressNotAvailable",
	title: "`Astro.clientAddress` is not available in prerendered pages.",
	message: "`Astro.clientAddress` is only available on pages that are server-rendered.",
	hint: "See https://docs.astro.build/en/guides/on-demand-rendering/ for more information on how to enable SSR."
};
/**
* @docs
* @see
* - [`getStaticPaths()`](https://docs.astro.build/en/reference/routing-reference/#getstaticpaths)
* @description
* A [dynamic route](https://docs.astro.build/en/guides/routing/#dynamic-routes) was matched, but no corresponding path was found for the requested parameters. This is often caused by a typo in either the generated or the requested path.
*/
export const NoMatchingStaticPathFound = {
	name: "NoMatchingStaticPathFound",
	title: "No static path found for requested path.",
	message: (pathName) => `A \`getStaticPaths()\` route pattern was matched, but no matching static path was found for requested path \`${pathName}\`.`,
	hint: (possibleRoutes) => `Possible dynamic routes being matched: ${possibleRoutes.join(", ")}.`
};
/**
* @docs
* @message Route returned a `RETURNED_VALUE`. Only a Response can be returned from Astro files.
* @see
* - [Response](https://docs.astro.build/en/guides/on-demand-rendering/#response)
* @description
* Only instances of [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) can be returned inside Astro files.
* ```astro title="pages/login.astro"
* ---
* return new Response(null, {
*  status: 404,
*  statusText: 'Not found'
* });
*
* // Alternatively, for redirects, `Astro.redirect()` also returns an instance of `Response`
* return Astro.redirect('/login');
* ---
* ```
*
*/
export const OnlyResponseCanBeReturned = {
	name: "OnlyResponseCanBeReturned",
	title: "Invalid type returned by Astro page.",
	message: (route, returnedValue) => `Route \`${route ? route : ""}\` returned a \`${returnedValue}\`. Only a [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) can be returned from Astro files.`,
	hint: "See https://docs.astro.build/en/guides/on-demand-rendering/#response for more information."
};
/**
* @docs
* @see
* - [`client:media`](https://docs.astro.build/en/reference/directives-reference/#clientmedia)
* @description
* A [media query](https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries) parameter is required when using the `client:media` directive.
*
* ```astro
* <Counter client:media="(max-width: 640px)" />
* ```
*/
export const MissingMediaQueryDirective = {
	name: "MissingMediaQueryDirective",
	title: "Missing value for `client:media` directive.",
	message: "Media query not provided for `client:media` directive. A media query similar to `client:media=\"(max-width: 600px)\"` must be provided."
};
/**
* @docs
* @message Unable to render `COMPONENT_NAME`. There are `RENDERER_COUNT` renderer(s) configured in your `astro.config.mjs` file, but none were able to server-side render `COMPONENT_NAME`.
* @see
* - [Frameworks components](https://docs.astro.build/en/guides/framework-components/)
* - [UI Frameworks](https://docs.astro.build/en/guides/integrations/#official-integrations)
* @description
* None of the installed integrations were able to render the component you imported. Make sure to install the appropriate integration for the type of component you are trying to include in your page.
*
* For JSX / TSX files, [@astrojs/react](https://docs.astro.build/en/guides/integrations-guide/react/), [@astrojs/preact](https://docs.astro.build/en/guides/integrations-guide/preact/) or [@astrojs/solid-js](https://docs.astro.build/en/guides/integrations-guide/solid-js/) can be used. For Vue and Svelte files, the [@astrojs/vue](https://docs.astro.build/en/guides/integrations-guide/vue/) and [@astrojs/svelte](https://docs.astro.build/en/guides/integrations-guide/svelte/) integrations can be used respectively
*/
export const NoMatchingRenderer = {
	name: "NoMatchingRenderer",
	title: "No matching renderer found.",
	message: (componentName, componentExtension, plural, validRenderersCount) => `Unable to render \`${componentName}\`.

${validRenderersCount > 0 ? `There ${plural ? "are" : "is"} ${validRenderersCount} renderer${plural ? "s" : ""} configured in your \`astro.config.mjs\` file,
but ${plural ? "none were" : "it was not"} able to server-side render \`${componentName}\`.` : `No valid renderer was found ${componentExtension ? `for the \`.${componentExtension}\` file extension.` : `for this file extension.`}`}`,
	hint: (probableRenderers) => `Did you mean to enable the ${probableRenderers} integration?\n\nSee https://docs.astro.build/en/guides/framework-components/ for more information on how to install and configure integrations.`
};
/**
* @docs
* @see
* - [addRenderer option](https://docs.astro.build/en/reference/integrations-reference/#addrenderer-option)
* - [Hydrating framework components](https://docs.astro.build/en/guides/framework-components/#hydrating-interactive-components)
* @description
* Astro tried to hydrate a component on the client, but the renderer used does not provide a client entrypoint to use to hydrate.
*
*/
export const NoClientEntrypoint = {
	name: "NoClientEntrypoint",
	title: "No client entrypoint specified in renderer.",
	message: (componentName, clientDirective, rendererName) => `\`${componentName}\` component has a \`client:${clientDirective}\` directive, but no client entrypoint was provided by \`${rendererName}\`.`,
	hint: "See https://docs.astro.build/en/reference/integrations-reference/#addrenderer-option for more information on how to configure your renderer."
};
/**
* @docs
* @see
* - [`client:only`](https://docs.astro.build/en/reference/directives-reference/#clientonly)
* @description
*
* `client:only` components are not run on the server, as such Astro does not know (and cannot guess) which renderer to use and require a hint. Like such:
*
* ```astro
*	<SomeReactComponent client:only="react" />
* ```
*/
export const NoClientOnlyHint = {
	name: "NoClientOnlyHint",
	title: "Missing hint on client:only directive.",
	message: (componentName) => `Unable to render \`${componentName}\`. When using the \`client:only\` hydration strategy, Astro needs a hint to use the correct renderer.`,
	hint: (probableRenderers) => `Did you mean to pass \`client:only="${probableRenderers}"\`? See https://docs.astro.build/en/reference/directives-reference/#clientonly for more information on \`client:only\`.`
};
/**
* @docs
* @see
* - [`getStaticPaths()`](https://docs.astro.build/en/reference/routing-reference/#getstaticpaths)
* - [`params`](https://docs.astro.build/en/reference/api-reference/#params)
* @description
* The `params` property in `getStaticPaths()`'s return value (an array of objects) should also be an object.
*
* ```astro title="pages/blog/[id].astro"
* ---
* export async function getStaticPaths() {
*	return [
*		{ params: { id: "blog" } },
* 		{ params: { id: "about" } }
* 	];
*}
*---
* ```
*/
export const InvalidGetStaticPathParam = {
	name: "InvalidGetStaticPathParam",
	title: "Invalid value returned by a route from `getStaticPaths()`.",
	message: (paramType) => `Invalid \`params\` value returned by a route from \`getStaticPaths()\`. Expected an \`object\`, got \`${paramType}\`.`,
	hint: "See https://docs.astro.build/en/reference/routing-reference/#getstaticpaths for more information on `getStaticPaths()`."
};
/**
* @docs
* @see
* - [`getStaticPaths()`](https://docs.astro.build/en/reference/routing-reference/#getstaticpaths)
* @description
* `getStaticPaths()`'s return value must be an array of objects. In most cases, this error happens because an array of arrays was returned. Using [`.flatMap()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flatMap) or a [`.flat()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flat) call may be useful.
*
* ```ts title="pages/blog/[id].astro"
* export async function getStaticPaths() {
*	return [ // <-- Array
*		{ params: { id: "blog" } }, // <-- Object
* 		{ params: { id: "about" } }
* 	];
*}
* ```
*/
export const InvalidGetStaticPathsEntry = {
	name: "InvalidGetStaticPathsEntry",
	title: "Invalid entry inside `getStaticPaths()`'s return value.",
	message: (entryType) => `Invalid entry returned by \`getStaticPaths()\`. Expected an object, got \`${entryType}\`.`,
	hint: "If you're using a `.map` call, you might be looking for `.flatMap()` instead. See https://docs.astro.build/en/reference/routing-reference/#getstaticpaths for more information on `getStaticPaths()`."
};
/**
* @docs
* @see
* - [`getStaticPaths()`](https://docs.astro.build/en/reference/routing-reference/#getstaticpaths)
* - [`params`](https://docs.astro.build/en/reference/api-reference/#params)
* @description
* `getStaticPaths()`'s return value must be an array of objects.
*
* ```ts title="pages/blog/[id].astro"
* export async function getStaticPaths() {
*	return [ // <-- Array
*		{ params: { id: "blog" } },
* 		{ params: { id: "about" } }
* 	];
*}
* ```
*/
export const InvalidGetStaticPathsReturn = {
	name: "InvalidGetStaticPathsReturn",
	title: "Invalid value returned by `getStaticPaths()`.",
	message: (returnType) => `Invalid type returned by \`getStaticPaths()\`. Expected an \`array\`, got \`${returnType}\`.`,
	hint: "See https://docs.astro.build/en/reference/routing-reference/#getstaticpaths for more information on `getStaticPaths()`."
};
/**
* @docs
* @see
* - [`getStaticPaths()`](https://docs.astro.build/en/reference/routing-reference/#getstaticpaths)
* - [`params`](https://docs.astro.build/en/reference/api-reference/#params)
* @description
* Every route specified by `getStaticPaths()` requires a `params` property specifying the path parameters needed to match the route.
*
* For instance, the following code:
* ```astro title="pages/blog/[id].astro"
* ---
* export async function getStaticPaths() {
* 	return [
* 		{ params: { id: '1' } }
* 	];
* }
* ---
* ```
* Will create the following route: `site.com/blog/1`.
*/
export const GetStaticPathsExpectedParams = {
	name: "GetStaticPathsExpectedParams",
	title: "Missing params property on `getStaticPaths()` route.",
	message: "Missing or empty required `params` property on `getStaticPaths()` route.",
	hint: "See https://docs.astro.build/en/reference/routing-reference/#getstaticpaths for more information on `getStaticPaths()`."
};
/**
* @docs
* @see
* - [`getStaticPaths()`](https://docs.astro.build/en/reference/routing-reference/#getstaticpaths)
* - [`params`](https://docs.astro.build/en/reference/api-reference/#params)
* @description
* Since `params` are encoded into the URL, only certain types are supported as values.
*
* ```astro title="/route/[id].astro"
* ---
* export async function getStaticPaths() {
* 	return [
* 		{ params: { id: '1' } } // Works
* 		{ params: { id: 2 } } // Does not work
* 		{ params: { id: false } } // Does not work
* 		{ params: { id: [1, 2] } } // Does not work
* 	];
* }
* ---
* ```
*
* In routes using [rest parameters](https://docs.astro.build/en/guides/routing/#rest-parameters), `undefined` can be used to represent a path with no parameters passed in the URL:
*
* ```astro title="/route/[...id].astro"
* ---
* export async function getStaticPaths() {
* 	return [
* 		{ params: { id: '1' } } // /route/1
* 		{ params: { id: '2' } } // /route/2
* 		{ params: { id: undefined } } // /route/
* 	];
* }
* ---
* ```
*/
export const GetStaticPathsInvalidRouteParam = {
	name: "GetStaticPathsInvalidRouteParam",
	title: "Invalid route parameter returned by `getStaticPaths()`.",
	message: (key, value, valueType) => `Invalid \`getStaticPaths()\` route parameter for \`${key}\`. Expected a string or undefined, received \`${valueType}\` (\`${value}\`).`,
	hint: "See https://docs.astro.build/en/reference/routing-reference/#getstaticpaths for more information on `getStaticPaths()`."
};
/**
* @docs
* @see
* - [Dynamic Routes](https://docs.astro.build/en/guides/routing/#dynamic-routes)
* - [`getStaticPaths()`](https://docs.astro.build/en/reference/routing-reference/#getstaticpaths)
* - [Server-side rendering](https://docs.astro.build/en/guides/on-demand-rendering/)
* @description
* In [Static Mode](https://docs.astro.build/en/guides/routing/#static-ssg-mode), all routes must be determined at build time. As such, dynamic routes must `export` a `getStaticPaths()` function returning the different paths to generate.
*/
export const GetStaticPathsRequired = {
	name: "GetStaticPathsRequired",
	title: "`getStaticPaths()` function required for dynamic routes.",
	message: "`getStaticPaths()` function is required for dynamic routes. Make sure that you `export` a `getStaticPaths()` function from your dynamic route.",
	hint: `See https://docs.astro.build/en/guides/routing/#dynamic-routes for more information on dynamic routes.

	If you meant for this route to be server-rendered, set \`export const prerender = false;\` in the page.`
};
/**
* @docs
* @see
* - [Named slots](https://docs.astro.build/en/basics/astro-components/#named-slots)
* @description
* Certain words cannot be used for slot names due to being already used internally.
*/
export const ReservedSlotName = {
	name: "ReservedSlotName",
	title: "Invalid slot name.",
	message: (slotName) => `Unable to create a slot named \`${slotName}\`. \`${slotName}\` is a reserved slot name. Please update the name of this slot.`
};
/**
* @docs
* @see
* - [Server-side rendering](https://docs.astro.build/en/guides/on-demand-rendering/)
* @description
* To use server-side rendering, an adapter needs to be installed so Astro knows how to generate the proper output for your targeted deployment platform.
*/
export const NoAdapterInstalled = {
	name: "NoAdapterInstalled",
	title: "Cannot use server-side rendering without an adapter.",
	message: `Cannot use server-rendered pages without an adapter. Please install and configure the appropriate server adapter for your final deployment.`,
	hint: "See https://docs.astro.build/en/guides/on-demand-rendering/ for more information."
};
/**
* @docs
* @see
* - [Server-side rendering](https://docs.astro.build/en/guides/on-demand-rendering/)
* @description
* The currently configured adapter does not support server-side rendering, which is required for the current project setup.
*
* Depending on your adapter, there may be a different entrypoint to use for server-side rendering. For example, the `@astrojs/vercel` adapter has a `@astrojs/vercel/static` entrypoint for static rendering, and a `@astrojs/vercel/serverless` entrypoint for server-side rendering.
*
*/
export const AdapterSupportOutputMismatch = {
	name: "AdapterSupportOutputMismatch",
	title: "Adapter does not support server output.",
	message: (adapterName) => `The \`${adapterName}\` adapter is configured to output a static website, but the project contains server-rendered pages. Please install and configure the appropriate server adapter for your final deployment.`
};
/**
* @docs
* @see
* - [On-demand Rendering](https://docs.astro.build/en/guides/on-demand-rendering/)
* @description
* To use server islands, the same constraints exist as for server-side rendering, so an adapter is needed.
*/
export const NoAdapterInstalledServerIslands = {
	name: "NoAdapterInstalledServerIslands",
	title: "Cannot use server islands without an adapter.",
	message: `Cannot use server islands without an adapter. Please install and configure the appropriate server adapter for your final deployment.`,
	hint: "See https://docs.astro.build/en/guides/on-demand-rendering/ for more information."
};
/**
* @docs
* @description
* No import statement was found for one of the components. If there is an import statement, make sure you are using the same identifier in both the imports and the component usage.
*/
export const NoMatchingImport = {
	name: "NoMatchingImport",
	title: "No import found for component.",
	message: (componentName) => `Could not render \`${componentName}\`. No matching import has been found for \`${componentName}\`.`,
	hint: "Please make sure the component is properly imported."
};
/**
* @docs
* @message
* **Example error messages:**<br/>
* InvalidPrerenderExport: A `prerender` export has been detected, but its value cannot be statically analyzed.
* @description
* The `prerender` feature only supports a subset of valid JavaScript — be sure to use exactly `export const prerender = true` so that our compiler can detect this directive at build time. Variables, `let`, and `var` declarations are not supported.
*/
export const InvalidPrerenderExport = {
	name: "InvalidPrerenderExport",
	title: "Invalid prerender export.",
	message(prefix, suffix, isHybridOutput) {
		const defaultExpectedValue = isHybridOutput ? "false" : "true";
		let msg = `A \`prerender\` export has been detected, but its value cannot be statically analyzed.`;
		if (prefix !== "const") msg += `\nExpected \`const\` declaration but got \`${prefix}\`.`;
		if (suffix !== "true") msg += `\nExpected \`${defaultExpectedValue}\` value but got \`${suffix}\`.`;
		return msg;
	},
	hint: "Mutable values declared at runtime are not supported. Please make sure to use exactly `export const prerender = true`."
};
/**
* @docs
* @message
* **Example error messages:**<br/>
* InvalidComponentArgs: Invalid arguments passed to `<MyAstroComponent>` component.
* @description
* Astro components cannot be rendered manually via a function call, such as `Component()` or `{items.map(Component)}`. Prefer the component syntax `<Component />` or `{items.map(item => <Component {...item} />)}`.
*/
export const InvalidComponentArgs = {
	name: "InvalidComponentArgs",
	title: "Invalid component arguments.",
	message: (name) => `Invalid arguments passed to${name ? ` <${name}>` : ""} component.`,
	hint: "Astro components cannot be rendered directly via function call, such as `Component()` or `{items.map(Component)}`."
};
/**
* @docs
* @see
* - [Pagination](https://docs.astro.build/en/guides/routing/#pagination)
* @description
* The page number parameter was not found in your filepath.
*/
export const PageNumberParamNotFound = {
	name: "PageNumberParamNotFound",
	title: "Page number param not found.",
	message: (paramName) => `[paginate()] page number param \`${paramName}\` not found in your filepath.`,
	hint: "Rename your file to `[page].astro` or `[...page].astro`."
};
/**
* @docs
* @see
* - [Images](https://docs.astro.build/en/guides/images/)
* - [Image component](https://docs.astro.build/en/reference/modules/astro-assets/#image-)
* - [Image component#alt](https://docs.astro.build/en/reference/modules/astro-assets/#alt-required)
* @description
* The `alt` property allows you to provide descriptive alt text to users of screen readers and other assistive technologies. In order to ensure your images are accessible, the `Image` component requires that an `alt` be specified.
*
* If the image is merely decorative (i.e. doesn’t contribute to the understanding of the page), set `alt=""` so that screen readers know to ignore the image.
*/
export const ImageMissingAlt = {
	name: "ImageMissingAlt",
	title: "Image missing required \"alt\" property.",
	message: "Image missing \"alt\" property. \"alt\" text is required to describe important images on the page.",
	hint: "Use an empty string (\"\") for decorative images."
};
/**
* @docs
* @see
* - [Image Service API](https://docs.astro.build/en/reference/image-service-reference/)
* @description
* There was an error while loading the configured image service. This can be caused by various factors, such as your image service not properly exporting a compatible object in its default export, or an incorrect path.
*
* If you believe that your service is properly configured and this error is wrong, please [open an issue](https://astro.build/issues/).
*/
export const InvalidImageService = {
	name: "InvalidImageService",
	title: "Error while loading image service.",
	message: "There was an error loading the configured image service. Please see the stack trace for more information."
};
/**
* @docs
* @message
* Missing width and height attributes for `IMAGE_URL`. When using remote images, both dimensions are required in order to avoid cumulative layout shift (CLS).
* @see
* - [Images](https://docs.astro.build/en/guides/images/)
* - [Image component#width-and-height-required](https://docs.astro.build/en/reference/modules/astro-assets/#width-and-height-required-for-images-in-public)
* @description
* For remote images, `width` and `height` cannot automatically be inferred from the original file. To avoid cumulative layout shift (CLS), either specify these two properties, or set [`inferSize`](https://docs.astro.build/en/reference/modules/astro-assets/#infersize) to `true` to fetch a remote image's original dimensions.
*
* If your image is inside your `src` folder, you probably meant to import it instead. See [the Imports guide for more information](https://docs.astro.build/en/guides/imports/#other-assets).
*/
export const MissingImageDimension = {
	name: "MissingImageDimension",
	title: "Missing image dimensions.",
	message: (missingDimension, imageURL) => `Missing ${missingDimension === "both" ? "width and height attributes" : `${missingDimension} attribute`} for ${imageURL}. When using remote images, both dimensions are required in order to avoid CLS.`,
	hint: "If your image is inside your `src` folder, you probably meant to import it instead. See [the Imports guide for more information](https://docs.astro.build/en/guides/imports/#other-assets). You can also use `inferSize={true}` for remote images to get the original dimensions."
};
/**
* @docs
* @message
* Failed to get the dimensions for `IMAGE_URL`.
* @description
* Determining the remote image's dimensions failed. This is typically caused by an incorrect URL or attempting to infer the size of an image in the public folder which is not possible.
*/
export const FailedToFetchRemoteImageDimensions = {
	name: "FailedToFetchRemoteImageDimensions",
	title: "Failed to retrieve remote image dimensions.",
	message: (imageURL) => `Failed to get the dimensions for ${imageURL}.`,
	hint: "Verify your remote image URL is accurate, and that you are not using `inferSize` with a file located in your `public/` folder."
};
/**
* @docs
* @message
* Remote image `IMAGE_URL` is not allowed by your image configuration.
* @description
* The remote image URL does not match your configured `image.domains` or `image.remotePatterns`.
*/
export const RemoteImageNotAllowed = {
	name: "RemoteImageNotAllowed",
	title: "Remote image is not allowed.",
	message: (imageURL) => `Remote image ${imageURL} is not allowed by your image configuration.`,
	hint: "Update `image.domains` or `image.remotePatterns`, or remove `inferSize` for this image."
};
/**
* @docs
* @description
* The built-in image services do not currently support optimizing all image formats.
*
* For unsupported formats such as GIFs, you may be able to use an `img` tag directly:
* ```astro
* ---
* import rocket from '../assets/images/rocket.gif';
* ---
*
* <img src={rocket.src} width={rocket.width} height={rocket.height} alt="A rocketship in space." />
* ```
*/
export const UnsupportedImageFormat = {
	name: "UnsupportedImageFormat",
	title: "Unsupported image format.",
	message: (format, imagePath, supportedFormats) => `Received unsupported format \`${format}\` from \`${imagePath}\`. Currently only ${supportedFormats.join(", ")} are supported by our image services.`,
	hint: "Using an `img` tag directly instead of the `Image` component might be what you're looking for."
};
/**
* @docs
* @see
* - [Images](https://docs.astro.build/en/guides/images/)
* @description
* Astro does not currently supporting converting between vector (such as SVGs) and raster (such as PNGs and JPEGs) images.
*/
export const UnsupportedImageConversion = {
	name: "UnsupportedImageConversion",
	title: "Unsupported image conversion.",
	message: "Converting between vector (such as SVGs) and raster (such as PNGs and JPEGs) images is not currently supported."
};
/**
* @docs
* @message An error occurred while optimizing the SVG file with the optimizer.
*/
export const CannotOptimizeSvg = {
	name: "CannotOptimizeSvg",
	title: "Cannot optimize SVG.",
	message: (path, name) => `An error occurred while optimizing SVG file "${path}" with the "${name}" optimizer.`,
	hint: "Review the included error message provided for guidance."
};
/**
* @docs
* @see
* - [`getStaticPaths()`](https://docs.astro.build/en/reference/routing-reference/#getstaticpaths)
* - [`params`](https://docs.astro.build/en/reference/api-reference/#params)
* @description
* The endpoint is prerendered with an `undefined` param so the generated path will collide with another route.
*
* If you cannot prevent passing `undefined`, then an additional extension can be added to the endpoint file name to generate the file with a different name. For example, renaming `pages/api/[slug].ts` to `pages/api/[slug].json.ts`.
*/
export const PrerenderDynamicEndpointPathCollide = {
	name: "PrerenderDynamicEndpointPathCollide",
	title: "Prerendered dynamic endpoint has path collision.",
	message: (pathname) => `Could not render \`${pathname}\` with an \`undefined\` param as the generated path will collide during prerendering. Prevent passing \`undefined\` as \`params\` for the endpoint's \`getStaticPaths()\` function, or add an additional extension to the endpoint's filename.`,
	hint: (filename) => `Rename \`${filename}\` to \`${filename.replace(/\.(?:js|ts)/, (m) => `.json` + m)}\``
};
/**
* @docs
* @see
* - [Route Priority Order](https://docs.astro.build/en/guides/routing/#route-priority-order)
* - [`prerenderConflictBehavior`](https://docs.astro.build/en/reference/configuration-reference/#prerenderconflictbehavior)
* @description
* Two prerendered routes generate the same path, resulting in a collision.
* A static path can only be generated by one route.
*/
export const PrerenderRouteConflict = {
	name: "PrerenderRouteConflict",
	title: "Prerendered route generates the same path as another route.",
	message: (winningRoute, thisRoute, pathname) => `Could not render \`${pathname}\` from route \`${thisRoute}\` as it conflicts with higher priority route \`${winningRoute}\`.`,
	hint: (winningRoute, thisRoute) => `Ensure \`${thisRoute}\` and \`${winningRoute}\` don't generate the same static paths.`
};
/**
* @docs
* @see
* - [Images](https://docs.astro.build/en/guides/images/)
* @description
* An image's `src` property is not valid. The Image component requires the `src` attribute to be either an image that has been ESM imported or a string. This is also true for the first parameter of `getImage()`.
*
* ```astro
* ---
* import { Image } from "astro:assets";
* import myImage from "../assets/my_image.png";
* ---
*
* <Image src={myImage} alt="..." />
* <Image src="https://example.com/logo.png" width={300} height={300} alt="..." />
* ```
*
* In most cases, this error happens when the value passed to `src` is undefined.
*/
export const ExpectedImage = {
	name: "ExpectedImage",
	title: "Expected src to be an image.",
	message: (src, typeofOptions, fullOptions) => `Expected \`src\` property for \`getImage\` or \`<Image />\` to be either an ESM imported image or a string with the path of a remote image. Received \`${src}\` (type: \`${typeofOptions}\`).\n\nFull serialized options received: \`${fullOptions}\`.`,
	hint: "This error can often happen because of a wrong path. Make sure the path to your image is correct. If you're passing an async function, make sure to call and await it."
};
/**
* @docs
* @see
* - [Images](https://docs.astro.build/en/guides/images/)
* @description
* `getImage()`'s first parameter should be an object with the different properties to apply to your image.
*
* ```ts
* import { getImage } from "astro:assets";
* import myImage from "../assets/my_image.png";
*
* const optimizedImage = await getImage({src: myImage, width: 300, height: 300});
* ```
*
* In most cases, this error happens because parameters were passed directly instead of inside an object.
*/
export const ExpectedImageOptions = {
	name: "ExpectedImageOptions",
	title: "Expected image options.",
	message: (options) => `Expected \`getImage()\` parameter to be an object. Received \`${options}\`.`
};
/**
* @docs
* @see
* - [Images](https://docs.astro.build/en/guides/images/)
* @description
* An ESM-imported image cannot be passed directly to `getImage()`. Instead, pass an object with the image in the `src` property.
*
* ```diff
* import { getImage } from "astro:assets";
* import myImage from "../assets/my_image.png";
* - const optimizedImage = await getImage( myImage );
* + const optimizedImage = await getImage({ src: myImage });
* ```
*/
export const ExpectedNotESMImage = {
	name: "ExpectedNotESMImage",
	title: "Expected image options, not an ESM-imported image.",
	message: "An ESM-imported image cannot be passed directly to `getImage()`. Instead, pass an object with the image in the `src` property.",
	hint: "Try changing `getImage(myImage)` to `getImage({ src: myImage })`"
};
/**
* @docs
* @see
* - [Images](https://docs.astro.build/en/guides/images/)
* - [`getImage()`](https://docs.astro.build/en/reference/modules/astro-assets/#getimage)
* @description
* The `getImage()` function is only available on the server. To use images on the client, either render the `src` from `getImage()` during the server render so it can be used in client-side scripts, or use a standard `<img>` tag.
*
* ```astro
* ---
* import { getImage } from "astro:assets";
* import myImage from "../assets/my_image.png";
*
* const optimizedImage = await getImage({ src: myImage, width: 300 });
* ---
*
* <script define:vars={{ imageSrc: optimizedImage.src }}>
*   // Use imageSrc in client-side code
*   document.getElementById('myImage').src = imageSrc;
* <\/script>
* ```
*/
export const GetImageNotUsedOnServer = {
	name: "GetImageNotUsedOnServer",
	title: "`getImage()` must be used on the server.",
	message: "`getImage()` should only be used on the server. To use images on the client, render the `src` from `getImage()` during the server render, then pass it to the client for usage.",
	hint: "See https://docs.astro.build/en/reference/modules/astro-assets/#getimage for more information on `getImage()`."
};
/**
* @docs
* @see
* - [Images](https://docs.astro.build/en/guides/images/)
* @description
* Only one of `densities` or `widths` can be specified. Those attributes are used to construct a `srcset` attribute, which cannot have both `x` and `w` descriptors.
*/
export const IncompatibleDescriptorOptions = {
	name: "IncompatibleDescriptorOptions",
	title: "Cannot set both `densities` and `widths`.",
	message: "Only one of `densities` or `widths` can be specified. In most cases, you'll probably want to use only `widths` if you require specific widths.",
	hint: "Those attributes are used to construct a `srcset` attribute, which cannot have both `x` and `w` descriptors."
};
/**
* @docs
* @see
* - [Images](https://docs.astro.build/en/guides/images/)
* @description
* Astro could not find an image you imported. Often, this is simply caused by a typo in the path.
*
* Images in Markdown are relative to the current file. To refer to an image that is located in the same folder as the `.md` file, the path should start with `./`
*/
export const ImageNotFound = {
	name: "ImageNotFound",
	title: "Image not found.",
	message: (imagePath) => `Could not find requested image \`${imagePath}\`. Does it exist?`,
	hint: "This is often caused by a typo in the image path. Please make sure the file exists, and is spelled correctly."
};
/**
* @docs
* @message Could not process image metadata for `IMAGE_PATH`.
* @see
* - [Images](https://docs.astro.build/en/guides/images/)
* @description
* Astro could not process the metadata of an image you imported. This is often caused by a corrupted or malformed image and re-exporting the image from your image editor may fix this issue.
*/
export const NoImageMetadata = {
	name: "NoImageMetadata",
	title: "Could not process image metadata.",
	message: (imagePath) => `Could not process image metadata${imagePath ? ` for \`${imagePath}\`` : ""}.`,
	hint: "This is often caused by a corrupted or malformed image. Re-exporting the image from your image editor may fix this issue."
};
/**
* @docs
* @see
* - [Images](https://docs.astro.build/en/guides/images/)
* @description
* Astro could not transform one of your images. Often, this is caused by a corrupted or malformed image. Re-exporting the image from your image editor may fix this issue.
*
* Depending on the image service you are using, the stack trace may contain more information on the specific error encountered.
*/
export const CouldNotTransformImage = {
	name: "CouldNotTransformImage",
	title: "Could not transform image.",
	message: (imagePath) => `Could not transform image \`${imagePath}\`. See the stack trace for more information.`,
	hint: "This is often caused by a corrupted or malformed image. Re-exporting the image from your image editor may fix this issue."
};
/**
* @docs
* @see
* - [HTML streaming](https://docs.astro.build/en/guides/on-demand-rendering/#html-streaming)
* @description
* Making changes to the response, such as setting headers, cookies, and the status code can only be done in [page components](https://docs.astro.build/en/basics/astro-pages/).
*/
export const ResponseSentError = {
	name: "ResponseSentError",
	title: "Unable to set response.",
	message: "The response has already been sent to the browser and cannot be altered."
};
/**
* @docs
* @description
* Thrown when the middleware does not return any data or call the `next` function.
*
* For example:
* ```ts
* import {defineMiddleware} from "astro:middleware";
* export const onRequest = defineMiddleware((context, _) => {
* 	// doesn't return anything or call `next`
* 	context.locals.someData = false;
* });
* ```
*/
export const MiddlewareNoDataOrNextCalled = {
	name: "MiddlewareNoDataOrNextCalled",
	title: "The middleware didn't return a `Response`.",
	message: "Make sure your middleware returns a `Response` object, either directly or by returning the `Response` from calling the `next` function."
};
/**
* @docs
* @description
* Thrown in development mode when middleware returns something that is not a `Response` object.
*
* For example:
* ```ts
* import {defineMiddleware} from "astro:middleware";
* export const onRequest = defineMiddleware(() => {
*   return "string"
* });
* ```
*/
export const MiddlewareNotAResponse = {
	name: "MiddlewareNotAResponse",
	title: "The middleware returned something that is not a `Response` object.",
	message: "Any data returned from middleware must be a valid `Response` object."
};
/**
* @docs
* @description
* Thrown when an endpoint does not return anything or returns an object that is not a `Response` object.
*
* An endpoint must return either a `Response`, or a `Promise` that resolves with a `Response`. For example:
* ```ts
* import type { APIContext } from 'astro';
*
* export async function GET({ request, url, cookies }: APIContext): Promise<Response> {
*     return Response.json({
*         success: true,
*         result: 'Data from Astro Endpoint!'
*     })
* }
* ```
*/
export const EndpointDidNotReturnAResponse = {
	name: "EndpointDidNotReturnAResponse",
	title: "The endpoint did not return a `Response`.",
	message: "An endpoint must return either a `Response`, or a `Promise` that resolves with a `Response`."
};
/**
* @docs
* @description
*
* Thrown when `locals` is overwritten with something that is not an object
*
* For example:
* ```ts
* import {defineMiddleware} from "astro:middleware";
* export const onRequest = defineMiddleware((context, next) => {
*   context.locals = 1541;
*   return next();
* });
* ```
*/
export const LocalsNotAnObject = {
	name: "LocalsNotAnObject",
	title: "Value assigned to `locals` is not accepted.",
	message: "`locals` can only be assigned to an object. Other values like numbers, strings, etc. are not accepted.",
	hint: "If you tried to remove some information from the `locals` object, try to use `delete` or set the property to `undefined`."
};
/**
* @docs
* @description
* Thrown when a value is being set as the `locals` field on the Astro global or context.
*/
export const LocalsReassigned = {
	name: "LocalsReassigned",
	title: "`locals` must not be reassigned.",
	message: "`locals` cannot be assigned directly.",
	hint: "Set a `locals` property instead."
};
/**
* @docs
* @description
* Thrown when a value is being set as the `headers` field on the `ResponseInit` object available as `Astro.response`.
*/
export const AstroResponseHeadersReassigned = {
	name: "AstroResponseHeadersReassigned",
	title: "`Astro.response.headers` must not be reassigned.",
	message: "Individual headers can be added to and removed from `Astro.response.headers`, but it must not be replaced with another instance of `Headers` altogether.",
	hint: "Consider using `Astro.response.headers.add()`, and `Astro.response.headers.delete()`."
};
/**
* @docs
* @description
* Thrown in development mode when middleware throws an error while attempting to loading it.
*
* For example:
* ```ts
* import {defineMiddleware} from "astro:middleware";
* throw new Error("Error thrown while loading the middleware.")
* export const onRequest = defineMiddleware(() => {
*   return "string"
* });
* ```
*/
export const MiddlewareCantBeLoaded = {
	name: "MiddlewareCantBeLoaded",
	title: "Can't load the middleware.",
	message: "An unknown error was thrown while loading your middleware."
};
/**
* @docs
* @see
* - [Images](https://docs.astro.build/en/guides/images/)
* @description
* When using the default image services, `Image`'s and `getImage`'s `src` parameter must be either an imported image or a URL, it cannot be a string of a filepath.
*
* For local images from content collections, you can use the [image() schema helper](https://docs.astro.build/en/guides/images/#images-in-content-collections) to resolve the images.
*
* ```astro
* ---
* import { Image } from "astro:assets";
* import myImage from "../my_image.png";
* ---
*
* <!-- GOOD: `src` is the full imported image. -->
* <Image src={myImage} alt="Cool image" />
*
* <!-- GOOD: `src` is a URL. -->
* <Image src="https://example.com/my_image.png" alt="Cool image" />
*
* <!-- BAD: `src` is an image's `src` path instead of the full image object. -->
* <Image src={myImage.src} alt="Cool image" />
*
* <!-- BAD: `src` is a string filepath. -->
* <Image src="../my_image.png" alt="Cool image" />
* ```
*/
export const LocalImageUsedWrongly = {
	name: "LocalImageUsedWrongly",
	title: "Local images must be imported.",
	message: (imageFilePath) => `\`Image\`'s and \`getImage\`'s \`src\` parameter must be an imported image or a URL, it cannot be a string filepath. Received \`${imageFilePath}\`.`,
	hint: "If you want to use an image from your `src` folder, you need to either import it or if the image is coming from a content collection, use the [image() schema helper](https://docs.astro.build/en/guides/images/#images-in-content-collections). See https://docs.astro.build/en/reference/modules/astro-assets/#src-required for more information on the `src` property."
};
/**
* @docs
* @description
* `Astro.glob()` can only be used in `.astro` files. You can use [`import.meta.glob()`](https://vite.dev/guide/features.html#glob-import) instead to achieve the same result.
* @deprecated This error was removed in Astro v6.0.0 along with the removal of `Astro.glob()`.
*/
export const AstroGlobUsedOutside = {
	name: "AstroGlobUsedOutside",
	title: "Astro.glob() used outside of an Astro file.",
	message: (globStr) => `\`Astro.glob(${globStr})\` can only be used in \`.astro\` files. \`import.meta.glob(${globStr})\` can be used instead to achieve a similar result.`,
	hint: "See Vite's documentation on `import.meta.glob` for more information: https://vite.dev/guide/features.html#glob-import"
};
/**
* @docs
* @description
* `Astro.glob()` did not return any matching files. There might be a typo in the glob pattern.
* @deprecated This error was removed in Astro v6.0.0 along with the removal of `Astro.glob()`.
*/
export const AstroGlobNoMatch = {
	name: "AstroGlobNoMatch",
	title: "Astro.glob() did not match any files.",
	message: (globStr) => `\`Astro.glob(${globStr})\` did not return any matching files.`,
	hint: "Check the pattern for typos."
};
/**
* @docs
* @see
* - [`Astro.redirect()`](https://docs.astro.build/en/reference/api-reference/#redirect)
* @description
* A redirect must be given a location with the `Location` header.
*/
export const RedirectWithNoLocation = {
	name: "RedirectWithNoLocation",
	title: "A redirect must be given a location with the `Location` header.",
	message: "The redirect `Response` has no `Location` header. Use `Astro.redirect()` to create redirects, or add a `Location` header to the `Response`."
};
/**
* @docs
* @see
* - [`Astro.redirect()`](https://docs.astro.build/en/reference/api-reference/#redirect)
* @description
* An external redirect must start with http or https, and must be a valid URL.
*/
export const UnsupportedExternalRedirect = {
	name: "UnsupportedExternalRedirect",
	title: "Unsupported or malformed URL.",
	message: (from, to) => `The destination URL in the external redirect from "${from}" to "${to}" is unsupported.`,
	hint: "An external redirect must start with http or https, and must be a valid URL."
};
/**
* @docs
* @message
* **Example error message:**<br/>
* InvalidRedirectDestination: The redirect from "/posts" to "/blog" is invalid. The destination "/blog" does not match any existing route in your project.
* @see
* - [Configured redirects](https://docs.astro.build/en/guides/routing/#configured-redirects)
* @description
* A dynamic redirect destination must match an existing route pattern and include
* all dynamic parameters from the source route.
* This error occurs when a redirect with dynamic parameters points to a destination
* that doesn't correspond to any page in your project, or when the destination route
* has fewer dynamic parameters than the source route.
*/
export const InvalidRedirectDestination = {
	name: "InvalidRedirectDestination",
	title: "Invalid redirect destination.",
	message(from, to, missingParams) {
		if (missingParams && missingParams.length > 0) {
			const formatted = missingParams.map((p) => `[${p}]`).join(", ");
			return `The redirect from "${from}" to "${to}" is invalid. The destination route is missing dynamic parameter(s) ${formatted} required by the source route "${from}".`;
		}
		return `The redirect from "${from}" to "${to}" is invalid. The destination "${to}" does not match any existing route in your project.`;
	},
	hint: "The destination of a dynamic redirect must include all dynamic parameters from the source route. For example, a redirect from \"/old/[slug]\" must go to a route that also has a [slug] parameter, like \"/new/[slug]\"."
};
/**
* @docs
* @see
* - [Dynamic routes](https://docs.astro.build/en/guides/routing/#dynamic-routes)
* @description
* A dynamic route param is invalid. This is often caused by an `undefined` parameter or a missing [rest parameter](https://docs.astro.build/en/guides/routing/#rest-parameters).
*/
export const InvalidDynamicRoute = {
	name: "InvalidDynamicRoute",
	title: "Invalid dynamic route.",
	message: (route, invalidParam, received) => `The ${invalidParam} param for route ${route} is invalid. Received **${received}**.`
};
/**
* @docs
* @see
* - [Default Image Service](https://docs.astro.build/en/guides/images/#default-image-service)
* - [Image Services API](https://docs.astro.build/en/reference/image-service-reference/)
* @description
* Sharp is the default image service used for `astro:assets`. When using a [strict package manager](https://pnpm.io/pnpm-vs-npm#npms-flat-tree) like pnpm, Sharp must be installed manually into your project in order to use image processing.
*
* If you are not using `astro:assets` for image processing, and do not wish to install Sharp, you can configure the following passthrough image service that does no processing:
*
* ```js
* import { defineConfig, passthroughImageService } from "astro/config";
* export default defineConfig({
*  image: {
*    service: passthroughImageService(),
*  },
* });
* ```
*/
export const MissingSharp = {
	name: "MissingSharp",
	title: "Could not find Sharp.",
	message: "Could not find Sharp. Please install Sharp (`sharp`) manually into your project or migrate to another image service.",
	hint: "See Sharp's installation instructions for more information: https://sharp.pixelplumbing.com/install. If you are not relying on `astro:assets` to optimize, transform, or process any images, you can configure a passthrough image service instead of installing Sharp. See https://docs.astro.build/en/reference/errors/missing-sharp for more information.\n\nSee https://docs.astro.build/en/guides/images/#default-image-service for more information on how to migrate to another image service."
};
// No headings here, that way Vite errors are merged with Astro ones in the docs, which makes more sense to users.
// Vite Errors - 4xxx
/**
* @docs
* @see
* - [Vite troubleshooting guide](https://vite.dev/guide/troubleshooting.html)
* @description
* Vite encountered an unknown error while rendering your project. We unfortunately do not know what happened (or we would tell you!)
*
* If you can reliably cause this error to happen, we'd appreciate if you could [open an issue](https://astro.build/issues/)
*/
export const UnknownViteError = {
	name: "UnknownViteError",
	title: "Unknown Vite error."
};
/**
* @docs
* @see
* - [Type Imports](https://docs.astro.build/en/guides/typescript/#type-imports)
* @description
* Astro could not import the requested file. Oftentimes, this is caused by the import path being wrong (either because the file does not exist, or there is a typo in the path)
*
* This message can also appear when a type is imported without specifying that it is a [type import](https://docs.astro.build/en/guides/typescript/#type-imports).
*/
export const FailedToLoadModuleSSR = {
	name: "FailedToLoadModuleSSR",
	title: "Could not import file.",
	message: (importName) => `Could not import \`${importName}\`.`,
	hint: "This is often caused by a typo in the import path. Please make sure the file exists."
};
/**
* @docs
* @see
* - [Glob Patterns](https://docs.astro.build/en/guides/imports/#glob-patterns)
* @description
* Astro encountered an invalid glob pattern. This is often caused by the glob pattern not being a valid file path.
* @deprecated This error was removed in Astro v6.0.0 along with the removal of `Astro.glob()`.
*/
export const InvalidGlob = {
	name: "InvalidGlob",
	title: "Invalid glob pattern.",
	message: (globPattern) => `Invalid glob pattern: \`${globPattern}\`. Glob patterns must start with './', '../' or '/'.`,
	hint: "See https://docs.astro.build/en/guides/imports/#glob-patterns for more information on supported glob patterns."
};
/**
* @docs
* @description
* Astro couldn't find the correct page to render, probably because it wasn't correctly mapped for SSR usage. This is an internal error.
*/
export const FailedToFindPageMapSSR = {
	name: "FailedToFindPageMapSSR",
	title: "Astro couldn't find the correct page to render.",
	message: "Astro couldn't find the correct page to render, probably because it wasn't correctly mapped for SSR usage. This is an internal error. Please file an issue."
};
/**
* @docs
* @description
* Astro can't find the requested locale. All supported locales must be configured in [`i18n.locales`](https://docs.astro.build/en/reference/configuration-reference/#i18nlocales) and have corresponding directories within `src/pages/`.
*/
export const MissingLocale = {
	name: "MissingLocale",
	title: "The provided locale does not exist.",
	message: (locale) => `The locale/path \`${locale}\` does not exist in the configured \`i18n.locales\`.`
};
/**
* @docs
* @description
* Astro could not find the index URL of your website. An index page is required so that Astro can create a redirect from the main index page to the localized index page of the default locale when using [`i18n.routing.prefixDefaultLocale`](https://docs.astro.build/en/reference/configuration-reference/#i18nroutingprefixdefaultlocale).
* @see
* - [Internationalization](https://docs.astro.build/en/guides/internationalization/#routing)
* - [`i18n.routing` Configuration Reference](https://docs.astro.build/en/reference/configuration-reference/#i18nrouting)
*/
export const MissingIndexForInternationalization = {
	name: "MissingIndexForInternationalization",
	title: "Index page not found.",
	message: (defaultLocale) => `Could not find index page. A root index page is required in order to create a redirect to the index URL of the default locale. (\`/${defaultLocale}\`)`,
	hint: (src) => `Create an index page (\`index.astro, index.md, etc.\`) in \`${src}\`.`
};
/**
* @docs
* @description
* Some internationalization functions are only available when Astro's own i18n routing is disabled by the configuration setting `i18n.routing: "manual"`.
*
* @see
* - [`i18n` routing](https://docs.astro.build/en/guides/internationalization/#routing)
*/
export const IncorrectStrategyForI18n = {
	name: "IncorrectStrategyForI18n",
	title: "Function incompatible with the current strategy.",
	message: (functionName) => `The function \`${functionName}\` can only be used when the \`i18n.routing.strategy\` is set to \`"manual"\`.`
};
/**
* @docs
* @description
* Static pages aren't yet supported with i18n domains. If you wish to enable this feature, you have to disable prerendering.
*/
export const NoPrerenderedRoutesWithDomains = {
	name: "NoPrerenderedRoutesWithDomains",
	title: "Prerendered routes aren't supported when internationalization domains are enabled.",
	message: (component) => `Static pages aren't yet supported with multiple domains. To enable this feature, you must disable prerendering for the page ${component}.`
};
/**
* @docs
* @description
* Astro throws an error if the user enables manual routing, but it doesn't have a middleware file.
*/
export const MissingMiddlewareForInternationalization = {
	name: "MissingMiddlewareForInternationalization",
	title: "Enabled manual internationalization routing without having a middleware.",
	message: "Your configuration setting `i18n.routing: 'manual'` requires you to provide your own i18n `middleware` file."
};
/**
* @docs
* @description
* An invalid i18n middleware configuration was detected.
*/
export const InvalidI18nMiddlewareConfiguration = {
	name: "InvalidI18nMiddlewareConfiguration",
	title: "Invalid internationalization middleware configuration.",
	message: "The option `redirectToDefaultLocale` can be enabled only when `prefixDefaultLocale` is also set to `true`; otherwise, redirects might cause infinite loops. Enable the option `prefixDefaultLocale` to continue to use `redirectToDefaultLocale`, or ensure both are set to `false`."
};
/**
* @docs
* @description
* Astro could not find an associated file with content while trying to render the route. This is an Astro error and not a user error. If restarting the dev server does not fix the problem, please file an issue.
*/
export const CantRenderPage = {
	name: "CantRenderPage",
	title: "Astro can't render the route.",
	message: "Astro cannot find any content to render for this route. There is no file or redirect associated with this route.",
	hint: "If you expect to find a route here, this may be an Astro bug. Please file an issue/restart the dev server."
};
/**
* @docs
* @description
* Astro could not find any code to handle a rejected `Promise`. Make sure all your promises have an `await` or `.catch()` handler.
*/
export const UnhandledRejection = {
	name: "UnhandledRejection",
	title: "Unhandled rejection.",
	message: (stack) => `Astro detected an unhandled rejection. Here's the stack trace:\n${stack}`,
	hint: "Make sure your promises all have an `await` or a `.catch()` handler."
};
/**
* @docs
* @description
* The `astro:i18n` module cannot be used without enabling i18n in your Astro config. To enable i18n, add a default locale and a list of supported locales to your Astro config:
* ```js
* import { defineConfig } from 'astro'
* export default defineConfig({
*  i18n: {
* 	 locales: ['en', 'fr'],
* 	 defaultLocale: 'en',
* 	},
* })
* ```
*
* For more information on internationalization support in Astro, see our [Internationalization guide](https://docs.astro.build/en/guides/internationalization/).
* @see
* - [Internationalization](https://docs.astro.build/en/guides/internationalization/)
* - [`i18n` Configuration Reference](https://docs.astro.build/en/reference/configuration-reference/#i18n)
*/
export const i18nNotEnabled = {
	name: "i18nNotEnabled",
	title: "Internationalization routing is not enabled.",
	message: "The `astro:i18n` module cannot be used without enabling `i18n` in your Astro config.",
	hint: "See https://docs.astro.build/en/guides/internationalization for a guide on setting up i18n."
};
/**
* @docs
* @description
* An i18n utility tried to use the locale from a URL path that does not contain one. You can prevent this error by using `pathHasLocale` to check URLs for a locale first before using i18n utilities.
*
*/
export const i18nNoLocaleFoundInPath = {
	name: "i18nNoLocaleFoundInPath",
	title: "The path doesn't contain any locale.",
	message: "You tried to use an i18n utility on a path that doesn't contain any locale. You can use `pathHasLocale` first to determine if the path has a locale."
};
/**
* @docs
* @description
* Astro couldn't find a route matching the one provided by the user.
*/
export const RouteNotFound = {
	name: "RouteNotFound",
	title: "Route not found.",
	message: `Astro could not find a route that matches the one you requested.`
};
/**
* @docs
* @description
* Some environment variables do not match the data type and/or properties defined in `env.schema`.
* @message
* The following environment variables defined in `env.schema` are invalid.
*/
export const EnvInvalidVariables = {
	name: "EnvInvalidVariables",
	title: "Invalid environment variables.",
	message: (errors) => `The following environment variables defined in \`env.schema\` are invalid:\n\n${errors.map((err) => `- ${err}`).join("\n")}\n`
};
/**
* @docs
* @description
* The configured `vite.envPrefix` includes prefixes that match environment variables declared with `access: "secret"` in `env.schema`.
* This would cause Vite to expose those secret values in client-side JavaScript bundles, bypassing the `access: "secret"` protection.
*
* To fix this, either:
* - Remove the conflicting prefixes from `vite.envPrefix`, or
* - Rename your secret environment variables to use a prefix that is not in `vite.envPrefix`.
*/
export const EnvPrefixConflictsWithSecret = {
	name: "EnvPrefixConflictsWithSecret",
	title: "`envPrefix` conflicts with secret environment variables.",
	message: (conflicts) => `The following environment variables are declared with \`access: "secret"\` in \`env.schema\`, but their names match a prefix in \`vite.envPrefix\`, which would expose them in client-side bundles:\n\n${conflicts.map((c) => `- ${c}`).join("\n")}\n\nEither remove the conflicting prefixes from \`vite.envPrefix\`, or rename these variables to use a prefix not in \`vite.envPrefix\`.`
};
/**
* @docs
* @description
* This module is only available server-side.
*/
export const ServerOnlyModule = {
	name: "ServerOnlyModule",
	title: "Module is only available server-side.",
	message: (name) => `The "${name}" module is only available server-side.`
};
/**
* @docs
* @description
* `Astro.rewrite()` cannot be used if the request body has already been read. If you need to read the body, first clone the request. For example:
*
* ```js
* const data = await Astro.request.clone().formData();
*
* Astro.rewrite("/target")
* ```
*
* @see
* - [Request.clone()](https://developer.mozilla.org/en-US/docs/Web/API/Request/clone)
* - [Astro.rewrite](https://docs.astro.build/en/reference/api-reference/#rewrite)
*/
export const RewriteWithBodyUsed = {
	name: "RewriteWithBodyUsed",
	title: "Cannot use `Astro.rewrite()` after the request body has been read.",
	message: "`Astro.rewrite()` cannot be used if the request body has already been read. If you need to read the body, first clone the request.",
	hint: "Read the body from `Astro.request.clone()` instead of `Astro.request`, so the original request can still be rewritten."
};
/**
* @docs
* @description
* `Astro.rewrite()` can't be used to rewrite an on-demand route with a static route when using the `"server"` output.
*
*/
export const ForbiddenRewrite = {
	name: "ForbiddenRewrite",
	title: "Forbidden rewrite to a static route.",
	message: (from, to, component) => `You tried to rewrite the on-demand route '${from}' with the static route '${to}', when using the 'server' output. \n\nThe static route '${to}' is rendered by the component
'${component}', which is marked as prerendered. This is a forbidden operation because during the build, the component '${component}' is compiled to an
HTML file, which can't be retrieved at runtime by Astro.`,
	hint: (component) => `Add \`export const prerender = false\` to the component '${component}', or use \`Astro.redirect()\`.`
};
/**
* @docs
* @description
* An unknown error occurred while reading or writing files to disk. It can be caused by many things, eg. missing permissions or a file not existing we attempt to read.
*/
export const UnknownFilesystemError = {
	name: "UnknownFilesystemError",
	title: "An unknown error occurred while reading or writing files to disk.",
	hint: "It can be caused by many things, eg. missing permissions or a file not existing we attempt to read. Check the error cause for more details."
};
/**
* @docs
* @description
* Cannot extract the font type from the given URL.
* @message
* An error occurred while trying to extract the font type from the given URL.
*/
export const CannotExtractFontType = {
	name: "CannotExtractFontType",
	title: "Cannot extract the font type from the given URL.",
	message: (url) => `An error occurred while trying to extract the font type from ${url}.`,
	hint: "Open an issue at https://github.com/withastro/astro/issues."
};
/**
* @docs
* @description
* Cannot determine weight and style from font file, update your family config and set `weight` and `style` manually instead.
* @message
* An error occurred while determining the weight and style from the local font file.
*/
export const CannotDetermineWeightAndStyleFromFontFile = {
	name: "CannotDetermineWeightAndStyleFromFontFile",
	title: "Cannot determine weight and style from font file.",
	message: (family, url) => `An error occurred while determining the \`weight\` and \`style\` from local family "${family}" font file: ${url}.`,
	hint: "Update your family config and set `weight` and `style` manually instead."
};
/**
* @docs
* @description
* Cannot fetch the given font file.
* @message
* An error occurred while fetching font file from the given URL.
*/
export const CannotFetchFontFile = {
	name: "CannotFetchFontFile",
	title: "Cannot fetch the given font file.",
	message: (url) => `An error occurred while fetching the font file from ${url}.`,
	hint: "This is often caused by connectivity issues. If the error persists, open an issue at https://github.com/withastro/astro/issues."
};
/**
* @docs
* @description
* Font family not found.
* @message
* No data was found for the `cssVariable` passed to the `<Font />` component.
*/
export const FontFamilyNotFound = {
	name: "FontFamilyNotFound",
	title: "Font family not found.",
	message: (family) => `No data was found for the \`"${family}"\` family passed to the \`<Font>\` component.`,
	hint: "This is often caused by a typo. Check that the `<Font />` component is using a `cssVariable` specified in your config."
};
/**
* @docs
* @description
* Font file URL not found.
* @message
* The URL passed to the `experimental_getFontFileURL()` function is invalid.
*/
export const FontFileUrlNotFound = {
	name: "FontFileUrlNotFound",
	title: "Font file URL not found.",
	message: (url) => `The \`"${url}"\` URL passed to the \`experimental_getFontFileURL()\` function is invalid.`,
	hint: "Make sure you pass a valid URL, obtained via the `fontData` object."
};
/**
* @docs
* @description
* `experimental_getFontFileURL()` requires the request URL with on-demand rendering.
*/
export const MissingGetFontFileRequestUrl = {
	name: "MissingGetFontFileRequestUrl",
	title: "`experimental_getFontFileURL()` requires the request URL with on-demand rendering.",
	hint: "Pass the request URL as the 2nd argument, for example `Astro.url`."
};
/**
* @docs
* @description
* Unavailable Astro global in `getStaticPaths()`.
* @message
* The Astro global is not available in `getStaticPaths()`.
*/
export const UnavailableAstroGlobal = {
	name: "UnavailableAstroGlobal",
	title: "Unavailable Astro global in `getStaticPaths()`.",
	message: (name) => `The Astro global is not available in this scope. Please remove \`Astro.${name}\` from your \`getStaticPaths()\` function.`
};
/**
* @docs
* @description
* Unable to load the logger.
* @message
* Couldn't load the logger at the given path.
*/
export const UnableToLoadLogger = {
	name: "UnableToLoadLogger",
	title: "Unable to load the logger.",
	message: (path) => `Couldn't load the logger at given path "${path}".`
};
/**
* @docs
* @description
* The configuration of the logger is not serializable.
* @message
* The configuration of the logger is not serializable.
*/
export const LoggerConfigurationNotSerializable = {
	name: "LoggerConfigurationNotSerializable",
	title: "The configuration of the logger is not serializable."
};
/**
* @docs
* @description
* `new FetchState(request)` can only be used inside an Astro server — the built
* server output or the dev server — where Astro provides the manifest describing
* your site. This error means it was called somewhere else, for example in a
* plain Node script that imports `astro/fetch`.
*
* If this error occurs inside an Astro-built server, please [open an issue](https://astro.build/issues/).
* @message
* `new FetchState(request)` was called outside of an Astro server, so no manifest is available.
*/
export const NoManifestAvailable = {
	name: "NoManifestAvailable",
	title: "No manifest available.",
	message: "`new FetchState(request)` was called outside of an Astro server, so no manifest is available.",
	hint: "Make sure this code runs as part of your Astro app, such as its fetch entrypoint. If this error occurred inside an Astro-built server, please open an issue at https://github.com/withastro/astro/issues."
};
/**
* @docs
* @kind heading
* @name CSS Errors
*/
// CSS Errors
/**
* @docs
* @see
* 	- [Styles and CSS](https://docs.astro.build/en/guides/styling/)
* @description
* Astro encountered an unknown error while parsing your CSS. Oftentimes, this is caused by a syntax error and the error message should contain more information.
*/
export const UnknownCSSError = {
	name: "UnknownCSSError",
	title: "Unknown CSS error."
};
/**
* @docs
* @message
* **Example error messages:**<br/>
* CSSSyntaxError: Missed semicolon<br/>
* CSSSyntaxError: Unclosed string<br/>
* @description
* Astro encountered an error while parsing your CSS, due to a syntax error. This is often caused by a missing semicolon.
*/
export const CSSSyntaxError = {
	name: "CSSSyntaxError",
	title: "CSS syntax error."
};
/**
* @docs
* @kind heading
* @name Markdown Errors
*/
// Markdown Errors
/**
* @docs
* @description
* Astro encountered an unknown error while parsing your Markdown. Oftentimes, this is caused by a syntax error and the error message should contain more information.
*/
export const UnknownMarkdownError = {
	name: "UnknownMarkdownError",
	title: "Unknown Markdown error."
};
/**
* @docs
* @message
* **Example error messages:**<br/>
* cannot read an implicit mapping pair; a colon is missed<br/>
* unexpected end of the stream within a double quoted scalar<br/>
* cannot read a block mapping entry; a multiline key may not be an implicit key
* @description
* Astro encountered an error while parsing the frontmatter of your Markdown file.
* This is often caused by a mistake in the syntax, such as a missing colon or a missing end quote.
*/
export const MarkdownFrontmatterParseError = {
	name: "MarkdownFrontmatterParseError",
	title: "Failed to parse Markdown frontmatter."
};
/**
* @docs
* @see
* - [Modifying frontmatter programmatically](https://docs.astro.build/en/guides/markdown-content/#modifying-frontmatter-programmatically)
* @description
* A remark or rehype plugin attempted to inject invalid frontmatter. This occurs when "astro.frontmatter" is set to `null`, `undefined`, or an invalid JSON object.
*/
export const InvalidFrontmatterInjectionError = {
	name: "InvalidFrontmatterInjectionError",
	title: "Invalid frontmatter injection.",
	message: "A remark or rehype plugin attempted to inject invalid frontmatter. Ensure \"astro.frontmatter\" is set to a valid JSON object that is not `null` or `undefined`.",
	hint: "See the frontmatter injection docs https://docs.astro.build/en/guides/markdown-content/#modifying-frontmatter-programmatically for more information."
};
/**
* @docs
* @see
* - [MDX installation and usage](https://docs.astro.build/en/guides/integrations-guide/mdx/)
* @description
* Unable to find the official `@astrojs/mdx` integration. This error is raised when using MDX files without an MDX integration installed.
*/
export const MdxIntegrationMissingError = {
	name: "MdxIntegrationMissingError",
	title: "MDX integration missing.",
	message: (file) => `Unable to render ${file}. Ensure that the \`@astrojs/mdx\` integration is installed.`,
	hint: "See the MDX integration docs for installation and usage instructions: https://docs.astro.build/en/guides/integrations-guide/mdx/"
};
// Config Errors - 7xxx
/**
* @docs
* @see
* - [Configuration Reference](https://docs.astro.build/en/reference/configuration-reference/)
* @description
* Astro encountered an unknown error loading your Astro configuration file.
* This is often caused by a syntax error in your config and the message should offer more information.
*
* If you can reliably cause this error to happen, we'd appreciate if you could [open an issue](https://astro.build/issues/)
*/
export const UnknownConfigError = {
	name: "UnknownConfigError",
	title: "Unknown configuration error."
};
/**
* @docs
* @see
* - [--config](https://docs.astro.build/en/reference/cli-reference/#--config-path)
* @description
* The specified configuration file using `--config` could not be found. Make sure that it exists or that the path is correct.
*/
export const ConfigNotFound = {
	name: "ConfigNotFound",
	title: "Specified configuration file not found.",
	message: (configFile) => `Unable to resolve \`--config "${configFile}"\`. Does the file exist?`
};
/**
* @docs
* @see
* - [Configuration reference](https://docs.astro.build/en/reference/configuration-reference/)
* @description
* Astro detected a legacy configuration option in your configuration file.
*/
export const ConfigLegacyKey = {
	name: "ConfigLegacyKey",
	title: "Legacy configuration detected.",
	message: (legacyConfigKey) => `Legacy configuration detected: \`${legacyConfigKey}\`.`,
	hint: "Please update your configuration to the new format.\nSee https://astro.build/config for more information."
};
/**
* @docs
* @kind heading
* @name CLI Errors
*/
// CLI Errors
/**
* @docs
* @description
* Astro encountered an unknown error while starting one of its CLI commands. The error message should contain more information.
*
* If you can reliably cause this error to happen, we'd appreciate if you could [open an issue](https://astro.build/issues/)
*/
export const UnknownCLIError = {
	name: "UnknownCLIError",
	title: "Unknown CLI error."
};
/**
* @docs
* @description
* `astro sync` command failed to generate content collection types.
* @see
* - [Content collections documentation](https://docs.astro.build/en/guides/content-collections/)
*/
export const GenerateContentTypesError = {
	name: "GenerateContentTypesError",
	title: "Failed to generate content types.",
	message: (errorMessage) => `\`astro sync\` command failed to generate content collection types: ${errorMessage}.`,
	hint: (fileName) => `This error is often caused by a syntax error inside your content, or your content configuration file. Check your ${fileName ?? "content config"} file for typos.`
};
/**
* @docs
* @kind heading
* @name Content Collection Errors
*/
// Content Collection Errors
/**
* @docs
* @description
* Astro encountered an unknown error loading your content collections.
* This can be caused by certain errors inside your `src/content.config.ts` file or some internal errors.
*
* If you can reliably cause this error to happen, we'd appreciate if you could [open an issue](https://astro.build/issues/)
*/
export const UnknownContentCollectionError = {
	name: "UnknownContentCollectionError",
	title: "Unknown content collection error."
};
/**
* @docs
* @description
* Astro tried to render a content collection entry that was undefined. This can happen if you try to render an entry that does not exist.
*/
export const RenderUndefinedEntryError = {
	name: "RenderUndefinedEntryError",
	title: "Attempted to render an undefined content collection entry.",
	hint: "Check if the entry is undefined before passing it to `render()`."
};
/**
* @docs
* @description
* The `getDataEntryById` and `getEntryBySlug` functions are deprecated and cannot be used with content collections. Use the `getEntry` function instead.
*/
export const GetEntryDeprecationError = {
	name: "GetEntryDeprecationError",
	title: "Invalid use of `getDataEntryById` or `getEntryBySlug` function.",
	message: (collection, method) => `The \`${method}\` function is deprecated and cannot be used to query the "${collection}" collection. Use \`getEntry\` instead.`,
	hint: "See https://docs.astro.build/en/guides/upgrade-to/v6/#removed-legacy-content-collections for more information."
};
/**
* @docs
* @message
* **Example error message:**<br/>
* **blog** → **post.md** frontmatter does not match collection schema.<br/>
* "title" is required.<br/>
* "date" must be a valid date.
* @description
* A Markdown or MDX entry does not match its collection schema.
* Make sure that all required fields are present, and that all fields are of the correct type.
* You can check against the collection schema in your `src/content.config.*` file.
* See the [Content collections documentation](https://docs.astro.build/en/guides/content-collections/) for more information.
* @deprecated This error only applies to legacy content collections which were removed in Astro 6.
*/
export const InvalidContentEntryFrontmatterError = {
	name: "InvalidContentEntryFrontmatterError",
	title: "Content entry frontmatter does not match schema.",
	message(collection, entryId, error) {
		return [`**${String(collection)} → ${String(entryId)}** frontmatter does not match collection schema.`, ...error.issues.map((issue) => `  **${issue.path.join(".")}**: ${issue.message}`)].join("\n");
	},
	hint: "See https://docs.astro.build/en/guides/content-collections/ for more information on content schemas."
};
/**
* @docs
* @message
* **Example error message:**<br/>
* **blog** → **post** data does not match collection schema.<br/>
* "title" is required.<br/>
* "date" must be a valid date.
* @description
* A content entry does not match its collection schema.
* Make sure that all required fields are present, and that all fields are of the correct type.
* You can check against the collection schema in your `src/content.config.*` file.
* See the [Content collections documentation](https://docs.astro.build/en/guides/content-collections/) for more information.
*/
export const InvalidContentEntryDataError = {
	name: "InvalidContentEntryDataError",
	title: "Content entry data does not match schema.",
	message(collection, entryId, error) {
		return [
			`**${String(collection)} → ${String(entryId)}** data does not match collection schema.\n`,
			...error.issues.map((issue) => `  **${issue.path.join(".")}**: ${issue.message}`),
			""
		].join("\n");
	},
	hint: "See https://docs.astro.build/en/guides/content-collections/ for more information on content schemas."
};
/**
* @docs
* @message
* **Example error message:**<br/>
* Found legacy content config file in "src/content/config.ts". Please move this file to "src/content.config.ts" and ensure each collection has a loader defined.<br/>
* @description
* A legacy content config file was found. Move the file to `src/content.config.ts` and update any collection definitions if needed.
* See the [Astro 6 migration guide](https://docs.astro.build/en/guides/upgrade-to/v6/#removed-legacy-content-collections) for more information.
*/
export const LegacyContentConfigError = {
	name: "LegacyContentConfigError",
	title: "Legacy content config file found.",
	message: (filename) => `Found legacy content config file in "${filename}". Please move this file to "src/content.config.${filename.split(".").at(-1)}" and ensure each collection has a loader defined.`,
	hint: "See https://docs.astro.build/en/guides/upgrade-to/v6/#removed-legacy-content-collections for more information on updating collections."
};
/**
* @docs
* @message
* **Example error message:**<br/>
* Collections must have a `loader` defined. Check your collection definitions in your content config file.<br/>
* @description
* A content collection is missing a `loader` definition. Make sure that each collection in your content config file has a `loader`.
* See the [Content collections documentation](https://docs.astro.build/en/guides/content-collections/) for more information.
*/
export const ContentCollectionMissingLoader = {
	name: "ContentCollectionMissingLoader",
	title: "Content collection is missing a `loader` definition.",
	message: (file = "your content config file") => `Collections must have a \`loader\` defined. Check your collection definitions in ${file}.`,
	hint: "See https://docs.astro.build/en/guides/content-collections/ for more information on content loaders and https://docs.astro.build/en/guides/upgrade-to/v6/#removed-legacy-content-collections for more information on migrating from legacy collections."
};
/**
* @docs
* @message
* **Example error message:**<br/>
* Invalid collection type "data". Remove the type from your collection definition in your content config file.
* @description
* Content collections should no longer have a `type` field. Remove this field from your content config file.
* See the [Astro 6 migration guide](https://docs.astro.build/en/guides/upgrade-to/v6/#removed-legacy-content-collections) for more information.
*/
export const ContentCollectionInvalidType = {
	name: "ContentCollectionInvalidType",
	title: "Content collection has an invalid `type` field.",
	message: (type, file = "your content config file") => `Invalid collection type "${type}". Remove the type from your collection definition in ${file}.`,
	hint: "See https://docs.astro.build/en/guides/upgrade-to/v6/#removed-legacy-content-collections for more information on migrating from legacy collections."
};
/**
* @docs
* @message
* **Example error message:**<br/>
* The content loader for the collection **blog** returned an entry with an invalid `id`:<br/>
* &#123;<br/>
*   "id": 1,<br/>
*   "title": "Hello, World!"<br/>
* &#125;
* @description
* A content loader returned an invalid `id`.
* Make sure that the `id` of the entry is a string.
* See the [Content collections documentation](https://docs.astro.build/en/guides/content-collections/) for more information.
*/
export const ContentLoaderReturnsInvalidId = {
	name: "ContentLoaderReturnsInvalidId",
	title: "Content loader returned an entry with an invalid `id`.",
	message(collection, entry) {
		return [`The content loader for the collection **${String(collection)}** returned an entry with an invalid \`id\`:`, JSON.stringify(entry, null, 2)].join("\n");
	},
	hint: "Make sure that the `id` of the entry is a string. See https://docs.astro.build/en/guides/content-collections/ for more information on content loaders."
};
/**
* @docs
* @message
* **Example error message:**<br/>
* **blog** → **post** data does not match collection schema.<br/>
* "title" is required.<br/>
* "date" must be a valid date.
* @description
* A content entry does not match its collection schema.
* Make sure that all required fields are present, and that all fields are of the correct type.
* You can check against the collection schema in your `src/content.config.*` file.
* See the [Content collections documentation](https://docs.astro.build/en/guides/content-collections/) for more information.
*/
export const ContentEntryDataError = {
	name: "ContentEntryDataError",
	title: "Content entry data does not match schema.",
	message(collection, entryId, error) {
		return [
			`**${String(collection)} → ${String(entryId)}** data does not match collection schema.\n`,
			...error.issues.map((issue) => `  **${issue.path.join(".")}**: ${issue.message}`),
			""
		].join("\n");
	},
	hint: "See https://docs.astro.build/en/guides/content-collections/ for more information on content schemas."
};
/**
* @docs
* @message
* **Example error message:**<br/>
* The schema cannot be a function for live collections. Please use a schema object instead. Check your collection definitions in your live content config file.
* @description
* Error in live content config.
* @see
* - [Defining live content schemas](https://docs.astro.build/en/reference/modules/astro-content/#schema-1)
*/
export const LiveContentConfigError = {
	name: "LiveContentConfigError",
	title: "Error in live content config.",
	message: (error, filename) => `${error} Check your collection definitions in ${filename ?? "your live content config file"}.`,
	hint: "See https://docs.astro.build/en/reference/modules/astro-content/#definelivecollection for more information on defining live content collections."
};
/**
* @docs
* @message
* **Example error message:**<br/>
* The loader for **blog** returned invalid data.<br/>
* Object is missing required property "id".
* @description
* The loader for a content collection returned invalid data.
* Inline loaders must return an array of objects with unique ID fields or a plain object with IDs as keys and entries as values.
*/
export const ContentLoaderInvalidDataError = {
	name: "ContentLoaderInvalidDataError",
	title: "Content entry is missing an ID.",
	message(collection, extra) {
		return `**${String(collection)}** entry is missing an ID.\n${extra}`;
	},
	hint: "See https://docs.astro.build/en/guides/content-collections/ for more information on content loaders."
};
/**
* @docs
* @message `COLLECTION_NAME` → `ENTRY_ID` has an invalid slug. `slug` must be a string.
* @see
* - [The reserved entry `slug` field](https://docs.astro.build/en/guides/content-collections/)
* @description
* A collection entry has an invalid `slug`. This field is reserved for generating entry slugs, and must be a string when present.
*/
export const InvalidContentEntrySlugError = {
	name: "InvalidContentEntrySlugError",
	title: "Invalid content entry slug.",
	message(collection, entryId) {
		return `${String(collection)} → ${String(entryId)} has an invalid slug. \`slug\` must be a string.`;
	},
	hint: "See https://docs.astro.build/en/guides/content-collections/ for more on the `slug` field."
};
/**
* @docs
* @see
* - [Legacy content collections](https://docs.astro.build/en/guides/upgrade-to/v5/#updating-existing-collections)
* @description
* A legacy content collection schema should not contain the `slug` field. This is reserved by Astro for generating entry slugs. Remove `slug` from your schema. You can still use custom slugs in your frontmatter.
*/
export const ContentSchemaContainsSlugError = {
	name: "ContentSchemaContainsSlugError",
	title: "Content schema should not contain `slug`.",
	message: (collectionName) => `A content collection schema should not contain \`slug\` since it is reserved for slug generation. Remove this from your ${collectionName} collection schema.`,
	hint: "See https://docs.astro.build/en/guides/content-collections/ for more on the `slug` field."
};
/**
* @docs
* @see
* - [Legacy content collections](https://docs.astro.build/en/guides/upgrade-to/v5/#updating-existing-collections)
* @description
* A legacy content collection cannot contain a mix of content and data entries. You must store entries in separate collections by type.
*/
export const MixedContentDataCollectionError = {
	name: "MixedContentDataCollectionError",
	title: "Content and data cannot be in same collection.",
	message: (collectionName) => `**${collectionName}** contains a mix of content and data entries. All entries must be of the same type.`,
	hint: "Store data entries in a new collection separate from your content collection."
};
/**
* @docs
* @see
* - [Legacy content collections](https://docs.astro.build/en/guides/upgrade-to/v5/#updating-existing-collections)
* @description
* Legacy content collections must contain entries of the type configured. Collections are `type: 'content'` by default. Try adding `type: 'data'` to your collection config for data collections.
*/
export const ContentCollectionTypeMismatchError = {
	name: "ContentCollectionTypeMismatchError",
	title: "Collection contains entries of a different type.",
	message: (collection, expectedType, actualType) => `${collection} contains ${expectedType} entries, but is configured as a ${actualType} collection.`
};
/**
* @docs
* @message `COLLECTION_ENTRY_NAME` failed to parse.
* @description
* Collection entries of `type: 'data'` must return an object with valid JSON (for `.json` entries), YAML (for `.yaml` entries) or TOML (for `.toml` entries).
*/
export const DataCollectionEntryParseError = {
	name: "DataCollectionEntryParseError",
	title: "Data collection entry failed to parse.",
	message(entryId, errorMessage) {
		return `**${entryId}** failed to parse: ${errorMessage}`;
	},
	hint: "Ensure your data entry is an object with valid JSON (for `.json` entries), YAML (for `.yaml` entries) or TOML (for `.toml` entries)."
};
/**
* @docs
* @message `COLLECTION_NAME` contains multiple entries with the same slug: `SLUG`. Slugs must be unique.
* @description
* Content collection entries must have unique slugs. Duplicates are often caused by the `slug` frontmatter property.
*/
export const DuplicateContentEntrySlugError = {
	name: "DuplicateContentEntrySlugError",
	title: "Duplicate content entry slug.",
	message(collection, slug, preExisting, alsoFound) {
		return `**${collection}** contains multiple entries with the same slug: \`${slug}\`. ` + `Slugs must be unique.\n\n` + `Entries: \n` + `- ${preExisting}\n` + `- ${alsoFound}`;
	}
};
/**
* @docs
* @see
* - [devalue library](https://github.com/rich-harris/devalue)
* @description
* `transform()` functions in your content config must return valid JSON, or data types compatible with the devalue library (including Dates, Maps, and Sets).
*/
export const UnsupportedConfigTransformError = {
	name: "UnsupportedConfigTransformError",
	title: "Unsupported transform in content config.",
	message: (parseError) => `\`transform()\` functions in your content config must return valid JSON, or data types compatible with the devalue library (including Dates, Maps, and Sets).\nFull error: ${parseError}`,
	hint: "See the devalue library for all supported types: https://github.com/rich-harris/devalue"
};
/**
* @docs
* @see
*  - [Passing a `parser` to the `file` loader](https://docs.astro.build/en/reference/content-loader-reference/#parser)
* @description
* The `file` loader can’t determine which parser to use. Please provide a custom parser (e.g. `csv-parse`) to create a collection from your file type.
*/
export const FileParserNotFound = {
	name: "FileParserNotFound",
	title: "File parser not found.",
	message: (fileName) => `No parser was found for '${fileName}'. Pass a parser function (e.g. \`parser: csv\`) to the \`file\` loader.`
};
/**
* @docs
* @see
*  - [Astro's built-in `file()` loader](https://docs.astro.build/en/reference/content-loader-reference/#file-loader)
* @description
* The `file` loader must be passed a single local file. Glob patterns are not supported. Use the built-in `glob` loader to create entries from patterns of multiple local files.
*/
export const FileGlobNotSupported = {
	name: "FileGlobNotSupported",
	title: "Glob patterns are not supported in the file loader.",
	message: "Glob patterns are not supported in the `file` loader. Use the `glob` loader instead.",
	hint: `See Astro's file loader https://docs.astro.build/en/reference/content-loader-reference/#file-loader for supported usage.`
};
/**
* @docs
* @kind heading
* @name Action Errors
*/
// Action Errors
/**
* @docs
* @see
* - [On-demand rendering](https://docs.astro.build/en/guides/on-demand-rendering/)
* @description
* Your project must have a server output to create backend functions with Actions.
*/
export const ActionsWithoutServerOutputError = {
	name: "ActionsWithoutServerOutputError",
	title: "Actions must be used with server output.",
	message: "A server is required to create callable backend functions. To deploy routes to a server, add an adapter to your Astro config and configure your route for on-demand rendering.",
	hint: "Add an adapter and enable on-demand rendering: https://docs.astro.build/en/guides/on-demand-rendering/"
};
/**
* @docs
* @see
* - [Actions handler reference](https://docs.astro.build/en/reference/modules/astro-actions/#handler-property)
* @description
* Action handler returned invalid data. Handlers should return serializable data types, and cannot return a Response object.
*/
export const ActionsReturnedInvalidDataError = {
	name: "ActionsReturnedInvalidDataError",
	title: "Action handler returned invalid data.",
	message: (error) => `Action handler returned invalid data. Handlers should return serializable data types like objects, arrays, strings, and numbers. Parse error: ${error}`,
	hint: "See the devalue library for all supported types: https://github.com/rich-harris/devalue"
};
/**
* @docs
* @description
* The server received a request for an action but could not find a match with the same name.
*/
export const ActionNotFoundError = {
	name: "ActionNotFoundError",
	title: "Action not found.",
	message: (actionName) => `The server received a request for an action named \`${actionName}\` but could not find a match. If you renamed an action, check that you've updated your \`actions/index\` file and your calling code to match.`,
	hint: "You can run `astro check` to detect type errors caused by mismatched action names."
};
/**
* @docs
* @see
* - [`Astro.callAction()` reference](https://docs.astro.build/en/reference/api-reference/#callaction)
* @description
* Action called from a server page or endpoint without using `Astro.callAction()`.
*/
export const ActionCalledFromServerError = {
	name: "ActionCalledFromServerError",
	title: "Action called from the server without `Astro.callAction()`.",
	message: "Action called from a server-rendered page or endpoint without using `Astro.callAction()`. This wrapper must be used to call actions from server code.",
	hint: "See the `Astro.callAction()` reference for usage examples: https://docs.astro.build/en/reference/api-reference/#callaction"
};
// Generic catch-all - Only use this in extreme cases, like if there was a cosmic ray bit flip.
export const UnknownError = {
	name: "UnknownError",
	title: "Unknown Error."
};
/**
* @docs
* @description
* Thrown in development mode when the actions file can't be loaded.
*
*/
export const ActionsCantBeLoaded = {
	name: "ActionsCantBeLoaded",
	title: "Can't load the Astro actions.",
	message: "An unknown error was thrown while loading the Astro actions file."
};
/**
* @docs
* @kind heading
* @name Session Errors
*/
// Session Errors
/**
* @docs
* @message Error when initializing session storage with driver `DRIVER`. `ERROR`
* @see
* 	- [Sessions](https://docs.astro.build/en/guides/sessions/)
* @description
* Thrown when the session storage could not be initialized.
*/
export const SessionStorageInitError = {
	name: "SessionStorageInitError",
	title: "Session storage could not be initialized.",
	message: (error, driver) => `Error when initializing session storage${driver ? ` with driver \`${driver}\`` : ""}. \`${error ?? ""}\``,
	hint: "For more information, see https://docs.astro.build/en/guides/sessions/"
};
/**
* @docs
* @message Error when saving session data with driver `DRIVER`. `ERROR`
* @see
* 	- [Sessions](https://docs.astro.build/en/guides/sessions/)
* @description
* Thrown when the session data could not be saved.
*/
export const SessionStorageSaveError = {
	name: "SessionStorageSaveError",
	title: "Session data could not be saved.",
	message: (error, driver) => `Error when saving session data${driver ? ` with driver \`${driver}\`` : ""}. \`${error ?? ""}\``,
	hint: "For more information, see https://docs.astro.build/en/guides/sessions/"
};
/**
* @docs
* @kind heading
* @name Cache Errors
*/
// Cache Errors
/**
* @docs
* @message Could not resolve the cache provider `PROVIDER`. Make sure the package is installed.
* @description
* Thrown when the configured cache provider cannot be resolved. This usually means the package is not installed or the import path is wrong.
*/
export const CacheProviderNotFound = {
	name: "CacheProviderNotFound",
	title: "Cache provider not found.",
	message: (provider) => `Could not resolve the cache provider \`${provider}\`. Make sure the package is installed.`,
	hint: "If your adapter provides a default cache provider, you may not need to set one explicitly. Check your adapter's documentation."
};
/**
* @docs
* @message `Astro.cache` is not available because the cache feature is not enabled.
* @description
* Thrown when `Astro.cache` or `context.cache` is used but the cache feature has not been enabled in the Astro config.
*/
export const CacheNotEnabled = {
	name: "CacheNotEnabled",
	title: "Cache is not enabled.",
	message: "`Astro.cache` is not available because the cache feature is not enabled. To use caching, configure a cache provider in your Astro config under `cache`.",
	hint: "Use an adapter that provides a default cache provider, or set one explicitly: `cache: { provider: \"...\" }`. See https://docs.astro.build/en/guides/caching/."
};
/**
* @docs
* @message `query.include` and `query.exclude` cannot be used together.
* @description
* The memory cache provider's `query.include` and `query.exclude` options are mutually exclusive.
* Use `include` to allowlist specific query parameters that affect the cache key, or `exclude` to
* blocklist parameters. When `include` is set, all other parameters are automatically ignored.
*/
export const CacheQueryConfigConflict = {
	name: "CacheQueryConfigConflict",
	title: "Conflicting cache query configuration.",
	message: "`query.include` and `query.exclude` cannot be used together. Use `include` to allowlist specific parameters, or `exclude` to blocklist them.",
	hint: "When using `include`, all parameters not in the list are automatically excluded, making `exclude` redundant."
};
/*
* Adding an error? Follow these steps:
* 1. Determine in which category it belongs (Astro, Vite, CSS, Content Collections etc.)
* 2. Add it at the bottom of the corresponding category above (see the @kind heading tags to see where they start), following the shape of the other errors.
* 4. If your message is dynamic, make sure the function shape is the following: `message: (something: type) => "my message"`, no `{}`, no `return` etc.
* 		- It has to be the simple shape, or the docs generator will not be able to parse it correctly.
* 		- If your message is fully dynamic (ex: lots of conditional logic), make `message` a proper function, like such: `message(parameters) { logic }`.
* 			Make sure to add a `@message` tag with a static example of the error message, the docs won't be able to parse it otherwise.
*  	- If your message is static, you can just use a string, `message: "my message"`.
* 5. Make sure to add a JSdoc comment with the `@docs` tag so that it shows up in the docs; otherwise, the error overlay will point to a 404!
* For more information, see the README in this folder!
*/