Repository: withastro/astro
File: packages/astro/src/core/errors/errors-data.ts (TypeScript)

Code before:
 * @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: string) =>
		`Static pages aren't yet supported with multiple domains. To enable this feature, you must disable prerendering for the page ${component}`,
} satisfies ErrorData;

/**
 * @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.",
} satisfies ErrorData;

/**
 * @docs
 * @description
 * Astro throws an error if the user passes an invalid configuration to the i18n middleware.
 */
export const InvalidI18nMiddlewareConfiguration = {
	name: 'InvalidI18nMiddlewareConfiguration',
	title: 'Invalid internationalization middleware configuration',
	message:
		'The option `redirectToDefaultLocale` can be enabled only when `prefixDefaultLocale` is set to `true`, otherwise redirects might cause infinite loops. Enable the option `prefixDefaultLocale`, or change its value to `false`.',
} satisfies ErrorData;

/**
 * @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',
} satisfies ErrorData;

/**
 * @docs
 * @description
 * Astro could not find any code to handle a rejected `Promise`. Make sure all your promises have an `await` or `.catch()` handler.

Review comment (suggestion):
```suggestion
 * An invalid i18n middleware configuration  was detected.
```
Shouldn't this be more like this?

Reminder: this is what will show up here in docs (as a subheading) - compare to the previous ones:

<img width="871" height="232" alt="image" src="https://github.com/user-attachments/assets/aa8d4ae8-08fe-4868-9ef8-101ac2ce1bc2" />

Code after:
 * @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: string) =>
		`Static pages aren't yet supported with multiple domains. To enable this feature, you must disable prerendering for the page ${component}`,
} satisfies ErrorData;

/**
 * @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.",
} satisfies ErrorData;

/**
 * @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`.',
} satisfies ErrorData;

/**
 * @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',
} satisfies ErrorData;

/**
 * @docs
 * @description
 * Astro could not find any code to handle a rejected `Promise`. Make sure all your promises have an `await` or `.catch()` handler.