import type { ZodError } from 'zod';
export interface ErrorData {
title: string;
message?: string | ((...params: any) => string);
hint?: string | ((...params: any) => string);
}
export declare const AstroErrorData: {
/**
* @docs
* @kind heading
* @name Astro Errors
*/
/**
* @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).
*/
readonly UnknownCompilerError: {
readonly title: "Unknown compiler error.";
readonly 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
* - [Enabling SSR in Your Project](https://docs.astro.build/en/guides/server-side-rendering/#enabling-ssr-in-your-project)
* - [Astro.redirect](https://docs.astro.build/en/reference/api-reference/#astroredirect)
* @description
* The `Astro.redirect` function is only available when [Server-side rendering](/en/guides/server-side-rendering/) is enabled.
*
* To redirect on a static website, the [meta refresh attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta) can be used. Certain hosts also provide config-based redirects (ex: [Netlify redirects](https://docs.netlify.com/routing/redirects/)).
* @deprecated since version 2.6
*/
readonly StaticRedirectNotAvailable: {
readonly title: "`Astro.redirect` is not available in static mode.";
readonly message: "Redirects are only available when using `output: 'server'` or `output: 'hybrid'`. Update your Astro config if you need SSR features.";
readonly hint: "See https://docs.astro.build/en/guides/server-side-rendering/#enabling-ssr-in-your-project for more information on how to enable SSR.";
};
/**
* @docs
* @see
* - [Official integrations](https://docs.astro.build/en/guides/integrations-guide/#official-integrations)
* - [Astro.clientAddress](https://docs.astro.build/en/reference/api-reference/#astroclientaddress)
* @description
* The adapter you're using unfortunately does not support `Astro.clientAddress`.
*/
readonly ClientAddressNotAvailable: {
readonly title: "`Astro.clientAddress` is not available in current adapter.";
readonly message: (adapterName: string) => string;
};
/**
* @docs
* @see
* - [Enabling SSR in Your Project](https://docs.astro.build/en/guides/server-side-rendering/#enabling-ssr-in-your-project)
* - [Astro.clientAddress](https://docs.astro.build/en/reference/api-reference/#astroclientaddress)
* @description
* The `Astro.clientAddress` property is only available when [Server-side rendering](https://docs.astro.build/en/guides/server-side-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.
*/
readonly StaticClientAddressNotAvailable: {
readonly title: "`Astro.clientAddress` is not available in static mode.";
readonly message: "`Astro.clientAddress` is only available when using `output: 'server'` or `output: 'hybrid'`. Update your Astro config if you need SSR features.";
readonly hint: "See https://docs.astro.build/en/guides/server-side-rendering/#enabling-ssr-in-your-project for more information on how to enable SSR.";
};
/**
* @docs
* @see
* - [getStaticPaths()](https://docs.astro.build/en/reference/api-reference/#getstaticpaths)
* @description
* A [dynamic route](https://docs.astro.build/en/core-concepts/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.
*/
readonly NoMatchingStaticPathFound: {
readonly title: "No static path found for requested path.";
readonly message: (pathName: string) => string;
readonly hint: (possibleRoutes: string[]) => string;
};
/**
* @docs
* @message Route returned a `RETURNED_VALUE`. Only a Response can be returned from Astro files.
* @see
* - [Response](https://docs.astro.build/en/guides/server-side-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');
* ---
* ```
*
*/
readonly OnlyResponseCanBeReturned: {
readonly title: "Invalid type returned by Astro page.";
readonly message: (route: string | undefined, returnedValue: string) => string;
readonly hint: "See https://docs.astro.build/en/guides/server-side-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
*
* ```
*/
readonly MissingMediaQueryDirective: {
readonly title: "Missing value for `client:media` directive.";
readonly 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/core-concepts/framework-components/)
* - [UI Frameworks](https://docs.astro.build/en/guides/integrations-guide/#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
*/
readonly NoMatchingRenderer: {
readonly title: "No matching renderer found.";
readonly message: (componentName: string, componentExtension: string | undefined, plural: boolean, validRenderersCount: number) => string;
readonly hint: (probableRenderers: string) => string;
};
/**
* @docs
* @see
* - [addRenderer option](https://docs.astro.build/en/reference/integrations-reference/#addrenderer-option)
* - [Hydrating framework components](https://docs.astro.build/en/core-concepts/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.
*
*/
readonly NoClientEntrypoint: {
readonly title: "No client entrypoint specified in renderer.";
readonly message: (componentName: string, clientDirective: string, rendererName: string) => string;
readonly 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
*
* ```
*/
readonly NoClientOnlyHint: {
readonly title: "Missing hint on client:only directive.";
readonly message: (componentName: string) => string;
readonly hint: (probableRenderers: string) => string;
};
/**
* @docs
* @see
* - [`getStaticPaths()`](https://docs.astro.build/en/reference/api-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: { slug: "blog" } },
* { params: { slug: "about" } }
* ];
*}
*---
* ```
*/
readonly InvalidGetStaticPathParam: {
readonly title: "Invalid value returned by a `getStaticPaths` path.";
readonly message: (paramType: any) => string;
readonly hint: "See https://docs.astro.build/en/reference/api-reference/#getstaticpaths for more information on getStaticPaths.";
};
/**
* @docs
* @see
* - [`getStaticPaths()`](https://docs.astro.build/en/reference/api-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: { slug: "blog" } },
* { params: { slug: "about" } }
* ];
*}
* ```
*/
readonly InvalidGetStaticPathsReturn: {
readonly title: "Invalid value returned by getStaticPaths.";
readonly message: (returnType: any) => string;
readonly hint: "See https://docs.astro.build/en/reference/api-reference/#getstaticpaths for more information on getStaticPaths.";
};
/**
* @docs
* @see
* - [RSS Guide](https://docs.astro.build/en/guides/rss/)
* @description
* `getStaticPaths` no longer expose an helper for generating a RSS feed. We recommend migrating to the [@astrojs/rss](https://docs.astro.build/en/guides/rss/#setting-up-astrojsrss)integration instead.
*/
readonly GetStaticPathsRemovedRSSHelper: {
readonly title: "getStaticPaths RSS helper is not available anymore.";
readonly message: "The RSS helper has been removed from `getStaticPaths`. Try the new @astrojs/rss package instead.";
readonly hint: "See https://docs.astro.build/en/guides/rss/ for more information.";
};
/**
* @docs
* @see
* - [`getStaticPaths()`](https://docs.astro.build/en/reference/api-reference/#getstaticpaths)
* - [`params`](https://docs.astro.build/en/reference/api-reference/#params)
* @description
* Every route specified by `getStaticPaths` require 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`.
*/
readonly GetStaticPathsExpectedParams: {
readonly title: "Missing params property on `getStaticPaths` route.";
readonly message: "Missing or empty required `params` property on `getStaticPaths` route.";
readonly hint: "See https://docs.astro.build/en/reference/api-reference/#getstaticpaths for more information on getStaticPaths.";
};
/**
* @docs
* @see
* - [`getStaticPaths()`](https://docs.astro.build/en/reference/api-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 } } // Works
* { params: { id: false } } // Does not work
* ];
* }
* ---
* ```
*
* In routes using [rest parameters](https://docs.astro.build/en/core-concepts/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/
* ];
* }
* ---
* ```
*/
readonly GetStaticPathsInvalidRouteParam: {
readonly title: "Invalid value for `getStaticPaths` route parameter.";
readonly message: (key: string, value: any, valueType: any) => string;
readonly hint: "See https://docs.astro.build/en/reference/api-reference/#getstaticpaths for more information on getStaticPaths.";
};
/**
* @docs
* @see
* - [Dynamic Routes](https://docs.astro.build/en/core-concepts/routing/#dynamic-routes)
* - [`getStaticPaths()`](https://docs.astro.build/en/reference/api-reference/#getstaticpaths)
* - [Server-side Rendering](https://docs.astro.build/en/guides/server-side-rendering/)
* @description
* In [Static Mode](https://docs.astro.build/en/core-concepts/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.
*/
readonly GetStaticPathsRequired: {
readonly title: "`getStaticPaths()` function required for dynamic routes.";
readonly message: "`getStaticPaths()` function is required for dynamic routes. Make sure that you `export` a `getStaticPaths` function from your dynamic route.";
readonly hint: "See https://docs.astro.build/en/core-concepts/routing/#dynamic-routes for more information on dynamic routes.\n\nAlternatively, set `output: \"server\"` in your Astro config file to switch to a non-static server build. This error can also occur if using `export const prerender = true;`.\nSee https://docs.astro.build/en/guides/server-side-rendering/ for more information on non-static rendering.";
};
/**
* @docs
* @see
* - [Named slots](https://docs.astro.build/en/core-concepts/astro-components/#named-slots)
* @description
* Certain words cannot be used for slot names due to being already used internally.
*/
readonly ReservedSlotName: {
readonly title: "Invalid slot name.";
readonly message: (slotName: string) => string;
};
/**
* @docs
* @see
* - [Server-side Rendering](https://docs.astro.build/en/guides/server-side-rendering/)
* - [Adding an Adapter](https://docs.astro.build/en/guides/server-side-rendering/#adding-an-adapter)
* @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.
*/
readonly NoAdapterInstalled: {
readonly title: "Cannot use Server-side Rendering without an adapter.";
readonly message: "Cannot use `output: 'server'` or `output: 'hybrid'` without an adapter. Please install and configure the appropriate server adapter for your final deployment.";
readonly hint: "See https://docs.astro.build/en/guides/server-side-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.
*/
readonly NoMatchingImport: {
readonly title: "No import found for component.";
readonly message: (componentName: string) => string;
readonly hint: "Please make sure the component is properly imported.";
};
/**
* @docs
* @message
* **Example error messages:**
* 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.
*/
readonly InvalidPrerenderExport: {
readonly title: "Invalid prerender export.";
readonly message: (prefix: string, suffix: string, isHydridOuput: boolean) => string;
readonly hint: "Mutable values declared at runtime are not supported. Please make sure to use exactly `export const prerender = true`.";
};
/**
* @docs
* @message
* **Example error messages:**
* InvalidComponentArgs: Invalid arguments passed to `` component.
* @description
* Astro components cannot be rendered manually via a function call, such as `Component()` or `{items.map(Component)}`. Prefer the component syntax `` or `{items.map(item => )}`.
*/
readonly InvalidComponentArgs: {
readonly title: "Invalid component arguments.";
readonly message: (name: string) => string;
readonly 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/core-concepts/routing/#pagination)
* @description
* The page number parameter was not found in your filepath.
*/
readonly PageNumberParamNotFound: {
readonly title: "Page number param not found.";
readonly message: (paramName: string) => string;
readonly hint: "Rename your file to `[page].astro` or `[...page].astro`.";
};
/**
* @docs
* @see
* - [Assets (Experimental)](https://docs.astro.build/en/guides/assets/)
* - [Image component](https://docs.astro.build/en/guides/assets/#image--astroassets)
* - [Image component#alt](https://docs.astro.build/en/guides/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.
*/
readonly ImageMissingAlt: {
readonly title: "Missing alt property.";
readonly message: "The alt property is required.";
readonly hint: "The `alt` property is important for the purpose of accessibility, without it users using screen readers or other assistive technologies won't be able to understand what your image is supposed to represent. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attr-alt for more information.";
};
/**
* @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/).
*/
readonly InvalidImageService: {
readonly title: "Error while loading image service.";
readonly 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 always required in order to avoid cumulative layout shift (CLS).
* @see
* - [Assets (Experimental)](https://docs.astro.build/en/guides/assets/)
* - [Image component#width-and-height](https://docs.astro.build/en/guides/assets/#width-and-height)
* @description
* For remote images, `width` and `height` cannot be inferred from the original file. As such, in order to avoid CLS, those two properties are always required.
*
* 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).
*/
readonly MissingImageDimension: {
readonly title: "Missing image dimensions";
readonly message: (missingDimension: 'width' | 'height' | 'both', imageURL: string) => string;
readonly 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).";
};
/**
* @docs
* @description
* The built-in image services do not currently support optimizing all image formats.
*
* For unsupported formats such as SVGs and GIFs, you may be able to use an `img` tag directly:
* ```astro
* ---
* import rocket from '../assets/images/rocket.svg';
* ---
*
*
* ```
*/
readonly UnsupportedImageFormat: {
readonly title: "Unsupported image format";
readonly message: (format: string, imagePath: string, supportedFormats: readonly string[]) => string;
readonly hint: "Using an `img` tag directly instead of the `Image` component might be what you're looking for.";
};
/**
* @docs
* @see
* - [`getStaticPaths()`](https://docs.astro.build/en/reference/api-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`.
*/
readonly PrerenderDynamicEndpointPathCollide: {
readonly title: "Prerendered dynamic endpoint has path collision.";
readonly message: (pathname: string) => string;
readonly hint: (filename: string) => string;
};
/**
* @docs
* @see
* - [Assets (Experimental)](https://docs.astro.build/en/guides/assets/)
* @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";
* ---
*
*
*
* ```
*
* In most cases, this error happens when the value passed to `src` is undefined.
*/
readonly ExpectedImage: {
readonly title: "Expected src to be an image.";
readonly message: (options: string) => string;
readonly hint: "This error can often happen because of a wrong path. Make sure the path to your image is correct.";
};
/**
* @docs
* @see
* - [Assets (Experimental)](https://docs.astro.build/en/guides/assets/)
* @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.
*/
readonly ExpectedImageOptions: {
readonly title: "Expected image options.";
readonly message: (options: string) => string;
};
/**
* @docs
* @message
* Could not find requested image `IMAGE_PATH` at `FULL_IMAGE_PATH`.
* @see
* - [Assets (Experimental)](https://docs.astro.build/en/guides/assets/)
* @description
* Astro could not find an image you included in your Markdown content. Usually, 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 `./`
*/
readonly MarkdownImageNotFound: {
readonly title: "Image not found.";
readonly message: (imagePath: string, fullImagePath: string | undefined) => string;
readonly hint: "This is often caused by a typo in the image path. Please make sure the file exists, and is spelled correctly.";
};
/**
* @docs
* @description
* Making changes to the response, such as setting headers, cookies, and the status code cannot be done outside of page components.
*/
readonly ResponseSentError: {
readonly title: "Unable to set response.";
readonly 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;
* });
* ```
*/
readonly MiddlewareNoDataOrNextCalled: {
readonly title: "The middleware didn't return a response or call `next`.";
readonly message: "The middleware needs to either return a `Response` object or call 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"
* });
* ```
*/
readonly MiddlewareNotAResponse: {
readonly title: "The middleware returned something that is not a `Response` object.";
readonly message: "Any data returned from middleware must be a valid `Response` object.";
};
/**
* @docs
* @description
*
* Thrown in development mode 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();
* });
* ```
*/
readonly LocalsNotAnObject: {
readonly title: "Value assigned to `locals` is not accepted.";
readonly message: "`locals` can only be assigned to an object. Other values like numbers, strings, etc. are not accepted.";
readonly hint: "If you tried to remove some information from the `locals` object, try to use `delete` or set the property to `undefined`.";
};
/**
* @docs
* @see
* - [Assets (Experimental)](https://docs.astro.build/en/guides/assets/)
* @description
* When using the default image services, `Image`'s and `getImage`'s `src` parameter must be either an imported image or an URL, it cannot be a filepath.
*
* ```astro
* ---
* import { Image } from "astro:assets";
* import myImage from "../my_image.png";
* ---
*
*
*
*
*
*
* ```
*/
readonly LocalImageUsedWrongly: {
readonly title: "ESM imported images must be passed as-is.";
readonly message: (imageFilePath: string) => string;
};
/**
* @docs
* @see
* - [Astro.glob](https://docs.astro.build/en/reference/api-reference/#astroglob)
* @description
* `Astro.glob()` can only be used in `.astro` files. You can use [`import.meta.glob()`](https://vitejs.dev/guide/features.html#glob-import) instead to acheive the same result.
*/
readonly AstroGlobUsedOutside: {
readonly title: "Astro.glob() used outside of an Astro file.";
readonly message: (globStr: string) => string;
readonly hint: "See Vite's documentation on `import.meta.glob` for more information: https://vitejs.dev/guide/features.html#glob-import";
};
/**
* @docs
* @see
* - [Astro.glob](https://docs.astro.build/en/reference/api-reference/#astroglob)
* @description
* `Astro.glob()` did not return any matching files. There might be a typo in the glob pattern.
*/
readonly AstroGlobNoMatch: {
readonly title: "Astro.glob() did not match any files.";
readonly message: (globStr: string) => string;
};
/**
* @docs
* @see
* - [Astro.redirect](https://docs.astro.build/en/reference/api-reference/#astroredirect)
* @description
* A redirect must be given a location with the `Location` header.
*/
readonly RedirectWithNoLocation: {
readonly title: "A redirect must be given a location with the `Location` header.";
};
/**
* @docs
* @see
* - [Dynamic routes](https://docs.astro.build/en/core-concepts/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/core-concepts/routing/#rest-parameters).
*/
readonly InvalidDynamicRoute: {
readonly title: "Invalid dynamic route.";
readonly message: (route: string, invalidParam: string, received: string) => string;
};
/**
* @docs
* @see
* - [Vite troubleshooting guide](https://vitejs.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/)
*/
readonly UnknownViteError: {
readonly 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).
*/
readonly FailedToLoadModuleSSR: {
readonly title: "Could not import file.";
readonly message: (importName: string) => string;
readonly 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.
*/
readonly InvalidGlob: {
readonly title: "Invalid glob pattern.";
readonly message: (globPattern: string) => string;
readonly 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.
*/
readonly FailedToFindPageMapSSR: {
readonly title: "Astro couldn't find the correct page to render";
readonly 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
* @kind heading
* @name 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.
*/
readonly UnknownCSSError: {
readonly title: "Unknown CSS Error.";
};
/**
* @docs
* @message
* **Example error messages:**
* CSSSyntaxError: Missed semicolon
* CSSSyntaxError: Unclosed string
* @description
* Astro encountered an error while parsing your CSS, due to a syntax error. This is often caused by a missing semicolon.
*/
readonly CSSSyntaxError: {
readonly title: "CSS Syntax Error.";
};
/**
* @docs
* @kind heading
* @name 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.
*/
readonly UnknownMarkdownError: {
readonly title: "Unknown Markdown Error.";
};
/**
* @docs
* @message
* **Example error messages:**
* can not read an implicit mapping pair; a colon is missed
* unexpected end of the stream within a double quoted scalar
* can not 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.
*/
readonly MarkdownFrontmatterParseError: {
readonly 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.
*/
readonly InvalidFrontmatterInjectionError: {
readonly title: "Invalid frontmatter injection.";
readonly 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`.";
readonly 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.
*/
readonly MdxIntegrationMissingError: {
readonly title: "MDX integration missing.";
readonly message: (file: string) => string;
readonly hint: "See the MDX integration docs for installation and usage instructions: https://docs.astro.build/en/guides/integrations-guide/mdx/";
};
/**
* @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/)
*/
readonly UnknownConfigError: {
readonly 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
*/
readonly ConfigNotFound: {
readonly title: "Specified configuration file not found.";
readonly message: (configFile: string) => string;
};
/**
* @docs
* @see
* - [Configuration reference](https://docs.astro.build/en/reference/configuration-reference/)
* @description
* Astro detected a legacy configuration option in your configuration file.
*/
readonly ConfigLegacyKey: {
readonly title: "Legacy configuration detected.";
readonly message: (legacyConfigKey: string) => string;
readonly hint: "Please update your configuration to the new format.\nSee https://astro.build/config for more information.";
};
/**
* @docs
* @kind heading
* @name 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/)
*/
readonly UnknownCLIError: {
readonly 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/)
*/
readonly GenerateContentTypesError: {
readonly title: "Failed to generate content types.";
readonly message: (errorMessage: string) => string;
readonly hint: "Check your `src/content/config.*` file for typos.";
};
/**
* @docs
* @kind heading
* @name 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/)
*/
readonly UnknownContentCollectionError: {
readonly title: "Unknown Content Collection Error.";
};
/**
* @docs
* @message
* **Example error message:**
* **blog** → **post.md** frontmatter does not match collection schema.
* "title" is required.
* "date" must be a valid date.
* @description
* A Markdown or MDX entry in `src/content/` 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.
*/
readonly InvalidContentEntryFrontmatterError: {
readonly title: "Content entry frontmatter does not match schema.";
readonly message: (collection: string, entryId: string, error: ZodError) => string;
readonly hint: "See https://docs.astro.build/en/guides/content-collections/ for more information on content schemas.";
};
/**
* @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
* An entry in `src/content/` has an invalid `slug`. This field is reserved for generating entry slugs, and must be a string when present.
*/
readonly InvalidContentEntrySlugError: {
readonly title: "Invalid content entry slug.";
readonly message: (collection: string, entryId: string) => string;
readonly hint: "See https://docs.astro.build/en/guides/content-collections/ for more on the `slug` field.";
};
/**
* @docs
* @see
* - [The reserved entry `slug` field](https://docs.astro.build/en/guides/content-collections/#defining-custom-slugs)
* @description
* A 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.
*/
readonly ContentSchemaContainsSlugError: {
readonly title: "Content Schema should not contain `slug`.";
readonly message: (collectionName: string) => string;
readonly hint: "See https://docs.astro.build/en/guides/content-collections/ for more on the `slug` field.";
};
/**
* @docs
* @message A collection queried via `getCollection()` does not exist.
* @description
* When querying a collection, ensure a collection directory with the requested name exists under `src/content/`.
*/
readonly CollectionDoesNotExistError: {
readonly title: "Collection does not exist";
readonly message: (collectionName: string) => string;
readonly hint: "See https://docs.astro.build/en/guides/content-collections/ for more on creating collections.";
};
/**
* @docs
* @message `COLLECTION_NAME` contains a mix of content and data entries. All entries must be of the same type.
* @see
* - [Defining content collections](https://docs.astro.build/en/guides/content-collections/#defining-collections)
* @description
* A content collection cannot contain a mix of content and data entries. You must store entries in separate collections by type.
*/
readonly MixedContentDataCollectionError: {
readonly title: "Content and data cannot be in same collection.";
readonly message: (collection: string) => string;
readonly hint: "Store data entries in a new collection separate from your content collection.";
};
/**
* @docs
* @message `COLLECTION_NAME` contains entries of type `ACTUAL_TYPE`, but is configured as a `EXPECTED_TYPE` collection.
* @see
* - [Defining content collections](https://docs.astro.build/en/guides/content-collections/#defining-collections)
* @description
* 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.
*/
readonly ContentCollectionTypeMismatchError: {
readonly title: "Collection contains entries of a different type.";
readonly message: (collection: string, expectedType: string, actualType: string) => string;
};
/**
* @docs
* @message `COLLECTION_ENTRY_NAME` failed to parse.
* @description
* Collection entries of `type: 'data'` must return an object with valid JSON (for `.json` entries) or YAML (for `.yaml` entries).
*/
readonly DataCollectionEntryParseError: {
readonly title: "Data collection entry failed to parse.";
readonly message: (entryId: string, errorMessage: string) => string;
readonly hint: "Ensure your data entry is an object with valid JSON (for `.json` entries) or YAML (for `.yaml` 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.
*/
readonly DuplicateContentEntrySlugError: {
readonly title: "Duplicate content entry slug.";
readonly message: (collection: string, slug: string) => string;
};
/**
* @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).
*/
readonly UnsupportedConfigTransformError: {
readonly title: "Unsupported transform in content config.";
readonly message: (parseError: string) => string;
readonly hint: "See the devalue library for all supported types: https://github.com/rich-harris/devalue";
};
readonly UnknownError: {
readonly title: "Unknown Error.";
};
};