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

Code before:
export const ActionCalledFromServerError = {
	name: 'ActionCalledFromServerError',
	title: 'Action unexpected called from the server.',
	message:
		'Action called from a server 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',
} satisfies ErrorData;

/**
 * @docs
 * @description
 * Cannot the module without enabling the experimental feature
 */
export const CantUseManifestModule = {
	name: 'CantUseManifestModule',
	title: 'Cannot the module without enabling the experimental feature.',
	message: (moduleName) =>
		`Cannot import the module "${moduleName}" because the experimental feature is disabled. Enable \`experimental.serializeManifest\` in your \`astro.config.mjs\` `,
} satisfies ErrorData;

/**
 * @docs
 * @description
 * Cannot the module without enabling the experimental feature
 */
export const ForbiddenManifestModule = {
	name: 'ForbiddenManifestModule',
	title: 'Forbidden use of module on the client side.',
	message:
		'The module `astro:manifest/server` cannot be used for client side scripts. Use `astro:manifest/client` instead.',
} satisfies ErrorData;

// 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.' } satisfies ErrorData;

/*
 * 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!
 */


Review comment (suggestion):
There's an error for this already called `ServerOnlyModule`

Code after:
export const ActionCalledFromServerError = {
	name: 'ActionCalledFromServerError',
	title: 'Action unexpected called from the server.',
	message:
		'Action called from a server 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',
} satisfies ErrorData;

/**
 * @docs
 * @description
 * Cannot the module without enabling the experimental feature
 */
export const CantUseManifestModule = {
	name: 'CantUseManifestModule',
	title: 'Cannot the module without enabling the experimental feature.',
	message: (moduleName) =>
		`Cannot import the module "${moduleName}" because the experimental feature is disabled. Enable \`experimental.serializeManifest\` in your \`astro.config.mjs\` `,
} satisfies ErrorData;

// 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.' } satisfies ErrorData;

/*
 * 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!
 */