From 5cb1b59a60d34e3d0c5d2fa96805c53149bd776d Mon Sep 17 00:00:00 2001 From: Emanuele Stoppa Date: Wed, 21 Aug 2024 09:37:32 +0100 Subject: [PATCH 1/3] chore: restore error and deprecate it --- 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..4bdf29ddcec9 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.15. + */ +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 From d3f9ccb3202e8cf526f3ed3ccc76a19785e8f5d7 Mon Sep 17 00:00:00 2001 From: Emanuele Stoppa Date: Wed, 21 Aug 2024 10:12:40 +0100 Subject: [PATCH 2/3] change deprecation version --- packages/astro/src/core/errors/errors-data.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/astro/src/core/errors/errors-data.ts b/packages/astro/src/core/errors/errors-data.ts index 4bdf29ddcec9..91b39d7e7874 100644 --- a/packages/astro/src/core/errors/errors-data.ts +++ b/packages/astro/src/core/errors/errors-data.ts @@ -1670,7 +1670,7 @@ export const ActionsWithoutServerOutputError = { * - [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.15. + * @deprecated Deprecated since version 4.14.4. */ export const ActionsUsedWithForGetError = { name: 'ActionsUsedWithForGetError', From d51f86e279953f28945203598337453570f4243a Mon Sep 17 00:00:00 2001 From: Emanuele Stoppa Date: Wed, 21 Aug 2024 10:18:28 +0100 Subject: [PATCH 3/3] Update packages/astro/src/core/errors/errors-data.ts --- packages/astro/src/core/errors/errors-data.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/astro/src/core/errors/errors-data.ts b/packages/astro/src/core/errors/errors-data.ts index 91b39d7e7874..d16cfdd969e3 100644 --- a/packages/astro/src/core/errors/errors-data.ts +++ b/packages/astro/src/core/errors/errors-data.ts @@ -1670,7 +1670,7 @@ export const ActionsWithoutServerOutputError = { * - [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.14.4. + * @deprecated Deprecated since version 4.13.2. */ export const ActionsUsedWithForGetError = { name: 'ActionsUsedWithForGetError',