From 6814ff07f56426dfce5b14355c07bed28fc28032 Mon Sep 17 00:00:00 2001 From: Emanuele Stoppa Date: Wed, 21 Aug 2024 10:19:21 +0100 Subject: [PATCH] chore: restore error and deprecate it (#11800) * chore: restore error and deprecate it * change deprecation version * Update packages/astro/src/core/errors/errors-data.ts --- packages/astro/src/core/errors/errors-data.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/packages/astro/src/core/errors/errors-data.ts b/packages/astro/src/core/errors/errors-data.ts index 33395bffac29..d16cfdd969e3 100644 --- a/packages/astro/src/core/errors/errors-data.ts +++ b/packages/astro/src/core/errors/errors-data.ts @@ -1664,6 +1664,22 @@ export const ActionsWithoutServerOutputError = { hint: 'Learn about on-demand rendering: https://docs.astro.build/en/basics/rendering-modes/#on-demand-rendered', } satisfies ErrorData; +/** + * @docs + * @see + * - [Actions RFC](https://github.com/withastro/roadmap/blob/actions/proposals/0046-actions.md) + * @description + * Action was called from a form using a GET request, but only POST requests are supported. This often occurs if `method="POST"` is missing on the form. + * @deprecated Deprecated since version 4.13.2. + */ +export const ActionsUsedWithForGetError = { + name: 'ActionsUsedWithForGetError', + title: 'An invalid Action query string was passed by a form.', + message: (actionName: string) => + `Action ${actionName} was called from a form using a GET request, but only POST requests are supported. This often occurs if \`method="POST"\` is missing on the form.`, + hint: 'Actions are experimental. Visit the RFC for usage instructions: https://github.com/withastro/roadmap/blob/actions/proposals/0046-actions.md', +} satisfies ErrorData; + /** * @docs * @see