From d8033579fd24a1f6db0deeb6c8790005f47b6624 Mon Sep 17 00:00:00 2001 From: Nin3 <30520689+Nin3lee@users.noreply.github.com> Date: Thu, 29 Aug 2024 10:01:57 +0800 Subject: [PATCH 01/22] i18n(zh-cn): add `actions-returned-invalid-data-error.mdx` --- .../errors/actions-returned-invalid-data-error.mdx | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/content/docs/zh-cn/reference/errors/actions-returned-invalid-data-error.mdx diff --git a/src/content/docs/zh-cn/reference/errors/actions-returned-invalid-data-error.mdx b/src/content/docs/zh-cn/reference/errors/actions-returned-invalid-data-error.mdx new file mode 100644 index 0000000000000..8896ede9bf842 --- /dev/null +++ b/src/content/docs/zh-cn/reference/errors/actions-returned-invalid-data-error.mdx @@ -0,0 +1,13 @@ +--- +title: Action handler returned invalid data. +i18nReady: true +githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts +--- +import DontEditWarning from '~/components/DontEditWarning.astro' + +> **ActionsReturnedInvalidDataError**: Action handler 返回了无效数据。handler 应该返回可序列化的数据类型,例如对象、数组、字符串和数字。解析错误:**错误** +## 哪里出了问题? +Action handler 返回了无效数据。handler 应该返回可序列化的数据类型,并且不能返回 Response 对象。 + +**另请参阅:** +- [Actions RFC](https://github.com/withastro/roadmap/blob/actions/proposals/0046-actions.md) From 897ae745f7babf26cd4813bb7e37f1601b75dce4 Mon Sep 17 00:00:00 2001 From: Nin3 <30520689+Nin3lee@users.noreply.github.com> Date: Thu, 29 Aug 2024 10:04:34 +0800 Subject: [PATCH 02/22] tiny edit --- .../reference/errors/actions-returned-invalid-data-error.mdx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/content/docs/zh-cn/reference/errors/actions-returned-invalid-data-error.mdx b/src/content/docs/zh-cn/reference/errors/actions-returned-invalid-data-error.mdx index 8896ede9bf842..ac08acb196c8d 100644 --- a/src/content/docs/zh-cn/reference/errors/actions-returned-invalid-data-error.mdx +++ b/src/content/docs/zh-cn/reference/errors/actions-returned-invalid-data-error.mdx @@ -6,6 +6,7 @@ githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/ import DontEditWarning from '~/components/DontEditWarning.astro' > **ActionsReturnedInvalidDataError**: Action handler 返回了无效数据。handler 应该返回可序列化的数据类型,例如对象、数组、字符串和数字。解析错误:**错误** + ## 哪里出了问题? Action handler 返回了无效数据。handler 应该返回可序列化的数据类型,并且不能返回 Response 对象。 From b6b86860c6b1a8e4713a6d80d1cf72db1b08d281 Mon Sep 17 00:00:00 2001 From: Nin3 <30520689+Nin3lee@users.noreply.github.com> Date: Thu, 29 Aug 2024 10:06:52 +0800 Subject: [PATCH 03/22] Update `error-reference.mdx` --- src/content/docs/zh-cn/reference/error-reference.mdx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/content/docs/zh-cn/reference/error-reference.mdx b/src/content/docs/zh-cn/reference/error-reference.mdx index 2492135a82136..5cb7b2a9a9aef 100644 --- a/src/content/docs/zh-cn/reference/error-reference.mdx +++ b/src/content/docs/zh-cn/reference/error-reference.mdx @@ -116,5 +116,6 @@ githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/ - [**ActionsWithoutServerOutputError**](/zh-cn/reference/errors/actions-without-server-output-error/)
Actions must be used with server output. - [**ActionsUsedWithForGetError**](/zh-cn/reference/errors/actions-used-with-for-get-error/)
An invalid Action query string was passed by a form. +- [**ActionsReturnedInvalidDataError**](/zh-cn/reference/errors/actions-returned-invalid-data-error/)
Action handler returned invalid data. - [**ActionQueryStringInvalidError**](/zh-cn/reference/errors/action-query-string-invalid-error/)
An invalid Action query string was passed by a form. - [**ActionCalledFromServerError**](/zh-cn/reference/errors/action-called-from-server-error/)
Action unexpected called from the server. From 01bd1bd103e262e13478aa50318fd49407a9c136 Mon Sep 17 00:00:00 2001 From: Nin3 <30520689+Nin3lee@users.noreply.github.com> Date: Fri, 30 Aug 2024 12:30:26 +0800 Subject: [PATCH 04/22] Update `actions-returned-invalid-data-error.mdx` --- .../reference/errors/actions-returned-invalid-data-error.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/zh-cn/reference/errors/actions-returned-invalid-data-error.mdx b/src/content/docs/zh-cn/reference/errors/actions-returned-invalid-data-error.mdx index ac08acb196c8d..b2d159bc9ab80 100644 --- a/src/content/docs/zh-cn/reference/errors/actions-returned-invalid-data-error.mdx +++ b/src/content/docs/zh-cn/reference/errors/actions-returned-invalid-data-error.mdx @@ -11,4 +11,4 @@ import DontEditWarning from '~/components/DontEditWarning.astro' Action handler 返回了无效数据。handler 应该返回可序列化的数据类型,并且不能返回 Response 对象。 **另请参阅:** -- [Actions RFC](https://github.com/withastro/roadmap/blob/actions/proposals/0046-actions.md) +- [Actions handler reference](/en/reference/api-reference/#handler-property) From 85654091269babc75b69b3ce0424d007d3a73354 Mon Sep 17 00:00:00 2001 From: Nin3 <30520689+Nin3lee@users.noreply.github.com> Date: Fri, 30 Aug 2024 12:52:52 +0800 Subject: [PATCH 05/22] Update actions-returned-invalid-data-error.mdx --- .../reference/errors/actions-returned-invalid-data-error.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/zh-cn/reference/errors/actions-returned-invalid-data-error.mdx b/src/content/docs/zh-cn/reference/errors/actions-returned-invalid-data-error.mdx index b2d159bc9ab80..e25590f4cd5cf 100644 --- a/src/content/docs/zh-cn/reference/errors/actions-returned-invalid-data-error.mdx +++ b/src/content/docs/zh-cn/reference/errors/actions-returned-invalid-data-error.mdx @@ -11,4 +11,4 @@ import DontEditWarning from '~/components/DontEditWarning.astro' Action handler 返回了无效数据。handler 应该返回可序列化的数据类型,并且不能返回 Response 对象。 **另请参阅:** -- [Actions handler reference](/en/reference/api-reference/#handler-property) +- [Actions handler 参考](/zh/reference/api-reference/#handler-属性) From 3a0079d6829bf6af9fb900713cfe72c1b31464d7 Mon Sep 17 00:00:00 2001 From: Nin3 <30520689+Nin3lee@users.noreply.github.com> Date: Fri, 30 Aug 2024 14:13:47 +0800 Subject: [PATCH 06/22] Update `error-reference.mdx` --- src/content/docs/zh-cn/reference/error-reference.mdx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/content/docs/zh-cn/reference/error-reference.mdx b/src/content/docs/zh-cn/reference/error-reference.mdx index 5cb7b2a9a9aef..06d68f75908ca 100644 --- a/src/content/docs/zh-cn/reference/error-reference.mdx +++ b/src/content/docs/zh-cn/reference/error-reference.mdx @@ -115,7 +115,6 @@ githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/ ## Action 错误 - [**ActionsWithoutServerOutputError**](/zh-cn/reference/errors/actions-without-server-output-error/)
Actions must be used with server output. -- [**ActionsUsedWithForGetError**](/zh-cn/reference/errors/actions-used-with-for-get-error/)
An invalid Action query string was passed by a form. - [**ActionsReturnedInvalidDataError**](/zh-cn/reference/errors/actions-returned-invalid-data-error/)
Action handler returned invalid data. -- [**ActionQueryStringInvalidError**](/zh-cn/reference/errors/action-query-string-invalid-error/)
An invalid Action query string was passed by a form. +- [**ActionNotFoundError**](/zh-cn/reference/errors/action-not-found-error/)
Action not found. - [**ActionCalledFromServerError**](/zh-cn/reference/errors/action-called-from-server-error/)
Action unexpected called from the server. From c056fa5948d54c3e1ebe5780498f7a958e341565 Mon Sep 17 00:00:00 2001 From: Nin3 <30520689+Nin3lee@users.noreply.github.com> Date: Fri, 30 Aug 2024 14:29:09 +0800 Subject: [PATCH 07/22] =?UTF-8?q?Update=20=C2=B7action-query-string-invali?= =?UTF-8?q?d-error.mdx=C2=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../reference/errors/action-query-string-invalid-error.mdx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/content/docs/zh-cn/reference/errors/action-query-string-invalid-error.mdx b/src/content/docs/zh-cn/reference/errors/action-query-string-invalid-error.mdx index 8cb411ea2dce1..a7c1b64ef80e8 100644 --- a/src/content/docs/zh-cn/reference/errors/action-query-string-invalid-error.mdx +++ b/src/content/docs/zh-cn/reference/errors/action-query-string-invalid-error.mdx @@ -4,6 +4,10 @@ i18nReady: true githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts --- +:::caution[已废弃] +此错误来自旧版本的 Astro,已不再使用。如果你无法将项目升级到新版本,那么你可以查阅 [未维护的旧文档快照](/zh-cn/upgrade-astro//#旧版本文档不再维护)以获取帮助。 +::: + > **ActionQueryStringInvalidError**: 服务器收到查询字符串 `?_astroAction=ACTION_NAME`,但找不到具有该名称的 action。如果你在开发过程中更改了 action 的名称,请从 URL 中删除此查询参数并刷新。 ## 哪里出了问题? From 2bdb5c5afa57e5785354e1251d668e747dbcf3a1 Mon Sep 17 00:00:00 2001 From: Nin3 <30520689+Nin3lee@users.noreply.github.com> Date: Fri, 30 Aug 2024 14:40:25 +0800 Subject: [PATCH 08/22] add `action-not-found-error.mdx` --- .../zh-cn/reference/errors/action-not-found-error.mdx | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 src/content/docs/zh-cn/reference/errors/action-not-found-error.mdx diff --git a/src/content/docs/zh-cn/reference/errors/action-not-found-error.mdx b/src/content/docs/zh-cn/reference/errors/action-not-found-error.mdx new file mode 100644 index 0000000000000..ff5f71d33fbb4 --- /dev/null +++ b/src/content/docs/zh-cn/reference/errors/action-not-found-error.mdx @@ -0,0 +1,11 @@ +--- +title: Action not found. +i18nReady: true +githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts +--- +import DontEditWarning from '~/components/DontEditWarning.astro' + +> **ActionNotFoundError**: 服务器接收到一个名为 `ACTION_NAME` 的 action 请求,但找不到匹配项。如果你重命名了 action,请检查你是否已经更新为匹配的 `actions/index` 文件和调用代码。 + +## 哪里出了问题? +服务器接收到了 action 的请求,但是无法找到同名的匹配项, From 6026a3d3e3d759d48d246a08ab8d10ded054ade1 Mon Sep 17 00:00:00 2001 From: Nin3 <30520689+Nin3lee@users.noreply.github.com> Date: Fri, 30 Aug 2024 14:41:09 +0800 Subject: [PATCH 09/22] Update `action-not-found-error.mdx` --- .../docs/zh-cn/reference/errors/action-not-found-error.mdx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/content/docs/zh-cn/reference/errors/action-not-found-error.mdx b/src/content/docs/zh-cn/reference/errors/action-not-found-error.mdx index ff5f71d33fbb4..150ac85028239 100644 --- a/src/content/docs/zh-cn/reference/errors/action-not-found-error.mdx +++ b/src/content/docs/zh-cn/reference/errors/action-not-found-error.mdx @@ -3,7 +3,6 @@ title: Action not found. i18nReady: true githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts --- -import DontEditWarning from '~/components/DontEditWarning.astro' > **ActionNotFoundError**: 服务器接收到一个名为 `ACTION_NAME` 的 action 请求,但找不到匹配项。如果你重命名了 action,请检查你是否已经更新为匹配的 `actions/index` 文件和调用代码。 From dee0ca21cf62b866bf178ef165dd2bbe6c435a04 Mon Sep 17 00:00:00 2001 From: Nin3 <30520689+Nin3lee@users.noreply.github.com> Date: Fri, 30 Aug 2024 14:44:13 +0800 Subject: [PATCH 10/22] tiny edit --- .../docs/zh-cn/reference/errors/action-not-found-error.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/zh-cn/reference/errors/action-not-found-error.mdx b/src/content/docs/zh-cn/reference/errors/action-not-found-error.mdx index 150ac85028239..075a56150926d 100644 --- a/src/content/docs/zh-cn/reference/errors/action-not-found-error.mdx +++ b/src/content/docs/zh-cn/reference/errors/action-not-found-error.mdx @@ -7,4 +7,4 @@ githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/ > **ActionNotFoundError**: 服务器接收到一个名为 `ACTION_NAME` 的 action 请求,但找不到匹配项。如果你重命名了 action,请检查你是否已经更新为匹配的 `actions/index` 文件和调用代码。 ## 哪里出了问题? -服务器接收到了 action 的请求,但是无法找到同名的匹配项, +服务器接收到了 action 的请求,但是无法找到同名的匹配项。 From 79f8a3cf4fce6f32cf9a353c17bc672762ea49be Mon Sep 17 00:00:00 2001 From: Nin3 <30520689+Nin3lee@users.noreply.github.com> Date: Fri, 30 Aug 2024 14:49:45 +0800 Subject: [PATCH 11/22] Update `action-called-from-server-error.mdx` --- .../reference/errors/action-called-from-server-error.mdx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/content/docs/zh-cn/reference/errors/action-called-from-server-error.mdx b/src/content/docs/zh-cn/reference/errors/action-called-from-server-error.mdx index a28ab88544eb6..ec511de278615 100644 --- a/src/content/docs/zh-cn/reference/errors/action-called-from-server-error.mdx +++ b/src/content/docs/zh-cn/reference/errors/action-called-from-server-error.mdx @@ -5,8 +5,11 @@ githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/ --- -> **ActionCalledFromServerError**: 在服务器页面或端点中调用了 action,但没有使用 `Astro.callAction()`。 +> **ActionCalledFromServerError**: 在服务器页面或端点中调用了 action,但没有使用 `Astro.callAction()`。该包装器必须用于从服务器代码调用 action。 ## 哪里出了问题? 在服务器页面或端点中调用了 action,但没有使用 `Astro.callAction()`。 + +**另请参阅:** +- [`Astro.callAction()` 参考](/zh-cn/reference/api-reference/#astrocallaction) From 88e9a13a89e137a5fa84fdc5cf1c11cb66b2c533 Mon Sep 17 00:00:00 2001 From: Nin3 <30520689+Nin3lee@users.noreply.github.com> Date: Fri, 30 Aug 2024 15:05:54 +0800 Subject: [PATCH 12/22] Update `env-invalid-variable.mdx` --- .../docs/zh-cn/reference/errors/env-invalid-variable.mdx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/content/docs/zh-cn/reference/errors/env-invalid-variable.mdx b/src/content/docs/zh-cn/reference/errors/env-invalid-variable.mdx index e3d051469508e..901f43add2fb5 100644 --- a/src/content/docs/zh-cn/reference/errors/env-invalid-variable.mdx +++ b/src/content/docs/zh-cn/reference/errors/env-invalid-variable.mdx @@ -4,6 +4,10 @@ i18nReady: true githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts --- +:::caution[已废弃] +此错误来自旧版本的 Astro,已不再使用。如果你无法将项目升级到新版本,那么你可以查阅 [未维护的旧文档快照](/zh-cn/upgrade-astro//#旧版本文档不再维护)以获取帮助。 +::: + > **EnvInvalidVariable**: 以下环境变量与 `experimental.env.schema` 中定义的数据类型和/或属性不匹配:KEY 不是 TYPE 类型 ## 发生了什么错误? From 52d0a04e5aba3acb870b031750f14ede5d54faee Mon Sep 17 00:00:00 2001 From: Nin3 <30520689+Nin3lee@users.noreply.github.com> Date: Fri, 30 Aug 2024 15:07:24 +0800 Subject: [PATCH 13/22] Update `invalid-rewrite404.mdx` --- .../docs/zh-cn/reference/errors/invalid-rewrite404.mdx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/content/docs/zh-cn/reference/errors/invalid-rewrite404.mdx b/src/content/docs/zh-cn/reference/errors/invalid-rewrite404.mdx index 7bacc04324d6d..9fd8a128f548e 100644 --- a/src/content/docs/zh-cn/reference/errors/invalid-rewrite404.mdx +++ b/src/content/docs/zh-cn/reference/errors/invalid-rewrite404.mdx @@ -4,6 +4,10 @@ i18nReady: true githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts --- +:::caution[已废弃] +此错误来自旧版本的 Astro,已不再使用。如果你无法将项目升级到新版本,那么你可以查阅 [未维护的旧文档快照](/zh-cn/upgrade-astro//#旧版本文档不再维护)以获取帮助。 +::: + > **InvalidRewrite404**: 只有在按需页面中才允许重写 404。 ## 发生了什么错误? From 2b02fb57dacb1e3621c41079dfd67dac4d6aa366 Mon Sep 17 00:00:00 2001 From: Nin3 <30520689+Nin3lee@users.noreply.github.com> Date: Fri, 30 Aug 2024 15:09:08 +0800 Subject: [PATCH 14/22] Update `locals-not-serializable.mdx` --- .../docs/zh-cn/reference/errors/locals-not-serializable.mdx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/content/docs/zh-cn/reference/errors/locals-not-serializable.mdx b/src/content/docs/zh-cn/reference/errors/locals-not-serializable.mdx index a4dbd3d620591..c1a081f6884f8 100644 --- a/src/content/docs/zh-cn/reference/errors/locals-not-serializable.mdx +++ b/src/content/docs/zh-cn/reference/errors/locals-not-serializable.mdx @@ -4,6 +4,10 @@ i18nReady: true githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts --- +:::caution[已废弃] +此错误来自旧版本的 Astro,已不再使用。如果你无法将项目升级到新版本,那么你可以查阅 [未维护的旧文档快照](/zh-cn/upgrade-astro/#旧版本文档不再维护)以获取帮助。 +::: + > **LocalsNotSerializable**:在路径 "`HREF`" 下存储的 `Astro.locals` 中的信息不可序列化。请确保只存储可序列化的数据。(E03034) ## 哪里发生了错误? From 04cf2162cdd57324798d97ee582fc72b9fd6f95c Mon Sep 17 00:00:00 2001 From: Nin3 <30520689+Nin3lee@users.noreply.github.com> Date: Fri, 30 Aug 2024 15:10:21 +0800 Subject: [PATCH 15/22] tiny edit --- .../docs/zh-cn/reference/errors/locals-not-serializable.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/zh-cn/reference/errors/locals-not-serializable.mdx b/src/content/docs/zh-cn/reference/errors/locals-not-serializable.mdx index c1a081f6884f8..7b69945ea623e 100644 --- a/src/content/docs/zh-cn/reference/errors/locals-not-serializable.mdx +++ b/src/content/docs/zh-cn/reference/errors/locals-not-serializable.mdx @@ -5,7 +5,7 @@ githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/ --- :::caution[已废弃] -此错误来自旧版本的 Astro,已不再使用。如果你无法将项目升级到新版本,那么你可以查阅 [未维护的旧文档快照](/zh-cn/upgrade-astro/#旧版本文档不再维护)以获取帮助。 +此错误来自旧版本的 Astro,已不再使用。如果你无法将项目升级到新版本,那么你可以查阅 [未维护的旧文档快照](/zh-cn/upgrade-astro/#旧版本文档不再维护) 以获取帮助。 ::: > **LocalsNotSerializable**:在路径 "`HREF`" 下存储的 `Astro.locals` 中的信息不可序列化。请确保只存储可序列化的数据。(E03034) From 3acfd364129aed6bbb01e51e6f2093bb800a30e0 Mon Sep 17 00:00:00 2001 From: Nin3 <30520689+Nin3lee@users.noreply.github.com> Date: Fri, 30 Aug 2024 15:11:27 +0800 Subject: [PATCH 16/22] fix broken link --- src/content/docs/zh-cn/reference/errors/invalid-rewrite404.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/zh-cn/reference/errors/invalid-rewrite404.mdx b/src/content/docs/zh-cn/reference/errors/invalid-rewrite404.mdx index 9fd8a128f548e..c531e48607dbb 100644 --- a/src/content/docs/zh-cn/reference/errors/invalid-rewrite404.mdx +++ b/src/content/docs/zh-cn/reference/errors/invalid-rewrite404.mdx @@ -5,7 +5,7 @@ githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/ --- :::caution[已废弃] -此错误来自旧版本的 Astro,已不再使用。如果你无法将项目升级到新版本,那么你可以查阅 [未维护的旧文档快照](/zh-cn/upgrade-astro//#旧版本文档不再维护)以获取帮助。 +此错误来自旧版本的 Astro,已不再使用。如果你无法将项目升级到新版本,那么你可以查阅 [未维护的旧文档快照](/zh-cn/upgrade-astro/#旧版本文档不再维护) 以获取帮助。 ::: > **InvalidRewrite404**: 只有在按需页面中才允许重写 404。 From 9d3c911692e578ceb90cb29dceba5f6e96e14298 Mon Sep 17 00:00:00 2001 From: Nin3 <30520689+Nin3lee@users.noreply.github.com> Date: Fri, 30 Aug 2024 15:12:18 +0800 Subject: [PATCH 17/22] fix broken link --- .../docs/zh-cn/reference/errors/env-invalid-variable.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/zh-cn/reference/errors/env-invalid-variable.mdx b/src/content/docs/zh-cn/reference/errors/env-invalid-variable.mdx index 901f43add2fb5..f5c3e4346030c 100644 --- a/src/content/docs/zh-cn/reference/errors/env-invalid-variable.mdx +++ b/src/content/docs/zh-cn/reference/errors/env-invalid-variable.mdx @@ -5,7 +5,7 @@ githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/ --- :::caution[已废弃] -此错误来自旧版本的 Astro,已不再使用。如果你无法将项目升级到新版本,那么你可以查阅 [未维护的旧文档快照](/zh-cn/upgrade-astro//#旧版本文档不再维护)以获取帮助。 +此错误来自旧版本的 Astro,已不再使用。如果你无法将项目升级到新版本,那么你可以查阅 [未维护的旧文档快照](/zh-cn/upgrade-astro/#旧版本文档不再维护) 以获取帮助。 ::: > **EnvInvalidVariable**: 以下环境变量与 `experimental.env.schema` 中定义的数据类型和/或属性不匹配:KEY 不是 TYPE 类型 From f3cae56afb8ad26fffdea1f89bc341011997f697 Mon Sep 17 00:00:00 2001 From: Nin3 <30520689+Nin3lee@users.noreply.github.com> Date: Fri, 30 Aug 2024 15:14:30 +0800 Subject: [PATCH 18/22] Update `markdown-content-schema-validation-error.mdx` --- .../errors/markdown-content-schema-validation-error.mdx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/content/docs/zh-cn/reference/errors/markdown-content-schema-validation-error.mdx b/src/content/docs/zh-cn/reference/errors/markdown-content-schema-validation-error.mdx index 5ffc590d5387d..e827086ad0d56 100644 --- a/src/content/docs/zh-cn/reference/errors/markdown-content-schema-validation-error.mdx +++ b/src/content/docs/zh-cn/reference/errors/markdown-content-schema-validation-error.mdx @@ -4,6 +4,10 @@ i18nReady: true githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts --- +:::caution[已废弃] +此错误来自旧版本的 Astro,已不再使用。如果你无法将项目升级到新版本,那么你可以查阅 [未维护的旧文档快照](/zh-cn/upgrade-astro/#旧版本文档不再维护) 以获取帮助。 +::: + > **错误信息示例:**
无法解析位于 **blog** → **post.md** 文件中的 frontmatter。
需要提供 "title" 字段。
From 04dcf018525fcb287be2e24336a9a680b7e39b15 Mon Sep 17 00:00:00 2001 From: Nin3 <30520689+Nin3lee@users.noreply.github.com> Date: Fri, 30 Aug 2024 15:22:58 +0800 Subject: [PATCH 19/22] fix broken link --- .../reference/errors/action-query-string-invalid-error.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/zh-cn/reference/errors/action-query-string-invalid-error.mdx b/src/content/docs/zh-cn/reference/errors/action-query-string-invalid-error.mdx index a7c1b64ef80e8..6e4275c706470 100644 --- a/src/content/docs/zh-cn/reference/errors/action-query-string-invalid-error.mdx +++ b/src/content/docs/zh-cn/reference/errors/action-query-string-invalid-error.mdx @@ -5,7 +5,7 @@ githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/ --- :::caution[已废弃] -此错误来自旧版本的 Astro,已不再使用。如果你无法将项目升级到新版本,那么你可以查阅 [未维护的旧文档快照](/zh-cn/upgrade-astro//#旧版本文档不再维护)以获取帮助。 +此错误来自旧版本的 Astro,已不再使用。如果你无法将项目升级到新版本,那么你可以查阅 [未维护的旧文档快照](/zh-cn/upgrade-astro/#旧版本文档不再维护) 以获取帮助。 ::: > **ActionQueryStringInvalidError**: 服务器收到查询字符串 `?_astroAction=ACTION_NAME`,但找不到具有该名称的 action。如果你在开发过程中更改了 action 的名称,请从 URL 中删除此查询参数并刷新。 From 8e329002c43da6a767da8d6462c94cdc96345b06 Mon Sep 17 00:00:00 2001 From: Nin3 <30520689+Nin3lee@users.noreply.github.com> Date: Fri, 30 Aug 2024 16:19:41 +0800 Subject: [PATCH 20/22] fix broken link Co-authored-by: liruifengv --- .../reference/errors/actions-returned-invalid-data-error.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/zh-cn/reference/errors/actions-returned-invalid-data-error.mdx b/src/content/docs/zh-cn/reference/errors/actions-returned-invalid-data-error.mdx index e25590f4cd5cf..34e256a9698f2 100644 --- a/src/content/docs/zh-cn/reference/errors/actions-returned-invalid-data-error.mdx +++ b/src/content/docs/zh-cn/reference/errors/actions-returned-invalid-data-error.mdx @@ -11,4 +11,4 @@ import DontEditWarning from '~/components/DontEditWarning.astro' Action handler 返回了无效数据。handler 应该返回可序列化的数据类型,并且不能返回 Response 对象。 **另请参阅:** -- [Actions handler 参考](/zh/reference/api-reference/#handler-属性) +- [Actions handler 参考](/zh-cn/reference/api-reference/#handler-属性) From b3042e29d48af592ae7fab3194c85c4c31a79d2f Mon Sep 17 00:00:00 2001 From: Nin3 <30520689+Nin3lee@users.noreply.github.com> Date: Tue, 3 Sep 2024 09:57:29 +0800 Subject: [PATCH 21/22] Update `error-reference.mdx` --- src/content/docs/zh-cn/reference/error-reference.mdx | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/content/docs/zh-cn/reference/error-reference.mdx b/src/content/docs/zh-cn/reference/error-reference.mdx index 06d68f75908ca..e18666a2a397c 100644 --- a/src/content/docs/zh-cn/reference/error-reference.mdx +++ b/src/content/docs/zh-cn/reference/error-reference.mdx @@ -9,7 +9,6 @@ githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/ ## Astro 错误 - [**UnknownCompilerError**](/zh-cn/reference/errors/unknown-compiler-error/)
Unknown compiler error. -- [**StaticRedirectNotAvailable**](/zh-cn/reference/errors/static-redirect-not-available/)
`Astro.redirect` is not available in static mode. - [**ClientAddressNotAvailable**](/zh-cn/reference/errors/client-address-not-available/)
`Astro.clientAddress` is not available in current adapter. - [**PrerenderClientAddressNotAvailable**](/zh-cn/reference/errors/prerender-client-address-not-available/)
`Astro.clientAddress` cannot be used inside prerendered routes. - [**StaticClientAddressNotAvailable**](/zh-cn/reference/errors/static-client-address-not-available/)
`Astro.clientAddress` is not available in static mode. @@ -22,7 +21,6 @@ githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/ - [**InvalidGetStaticPathParam**](/zh-cn/reference/errors/invalid-get-static-path-param/)
Invalid value returned by a `getStaticPaths` path. - [**InvalidGetStaticPathsEntry**](/zh-cn/reference/errors/invalid-get-static-paths-entry/)
Invalid entry inside getStaticPath's return value - [**InvalidGetStaticPathsReturn**](/zh-cn/reference/errors/invalid-get-static-paths-return/)
Invalid value returned by getStaticPaths. -- [**GetStaticPathsRemovedRSSHelper**](/zh-cn/reference/errors/get-static-paths-removed-rsshelper/)
getStaticPaths RSS helper is not available anymore. - [**GetStaticPathsExpectedParams**](/zh-cn/reference/errors/get-static-paths-expected-params/)
Missing params property on `getStaticPaths` route. - [**GetStaticPathsInvalidRouteParam**](/zh-cn/reference/errors/get-static-paths-invalid-route-param/)
Invalid value for `getStaticPaths` route parameter. - [**GetStaticPathsRequired**](/zh-cn/reference/errors/get-static-paths-required/)
`getStaticPaths()` function required for dynamic routes. @@ -45,7 +43,6 @@ githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/ - [**IncompatibleDescriptorOptions**](/zh-cn/reference/errors/incompatible-descriptor-options/)
Cannot set both `densities` and `widths` - [**ImageNotFound**](/zh-cn/reference/errors/image-not-found/)
Image not found. - [**NoImageMetadata**](/zh-cn/reference/errors/no-image-metadata/)
Could not process image metadata. -- [**MarkdownImageNotFound**](/zh-cn/reference/errors/markdown-image-not-found/)
Image not found. - [**CouldNotTransformImage**](/zh-cn/reference/errors/could-not-transform-image/)
Could not transform image. - [**ResponseSentError**](/zh-cn/reference/errors/response-sent-error/)
Unable to set response. - [**MiddlewareNoDataOrNextCalled**](/zh-cn/reference/errors/middleware-no-data-or-next-called/)
The middleware didn't return a `Response`. @@ -69,7 +66,6 @@ githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/ - [**IncorrectStrategyForI18n**](/zh-cn/reference/errors/incorrect-strategy-for-i18n/)
You can't use the current function with the current strategy - [**NoPrerenderedRoutesWithDomains**](/zh-cn/reference/errors/no-prerendered-routes-with-domains/)
Prerendered routes aren't supported when internationalization domains are enabled. - [**MissingMiddlewareForInternationalization**](/zh-cn/reference/errors/missing-middleware-for-internationalization/)
Enabled manual internationalization routing without having a middleware. -- [**RewriteEncounteredAnError**](/zh-cn/reference/errors/rewrite-encountered-an-error/)
Astro couldn't find the route to rewrite, or if was found but it emitted an error during the rendering phase. - [**CantRenderPage**](/zh-cn/reference/errors/cant-render-page/)
Astro can't render the route. - [**UnhandledRejection**](/zh-cn/reference/errors/unhandled-rejection/)
Unhandled rejection - [**i18nNotEnabled**](/zh-cn/reference/errors/i18n-not-enabled/)
i18n Not Enabled @@ -105,7 +101,6 @@ githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/ - [**InvalidContentEntryFrontmatterError**](/zh-cn/reference/errors/invalid-content-entry-frontmatter-error/)
Content entry frontmatter does not match schema. - [**InvalidContentEntrySlugError**](/zh-cn/reference/errors/invalid-content-entry-slug-error/)
Invalid content entry slug. - [**ContentSchemaContainsSlugError**](/zh-cn/reference/errors/content-schema-contains-slug-error/)
Content Schema should not contain `slug`. -- [**CollectionDoesNotExistError**](/zh-cn/reference/errors/collection-does-not-exist-error/)
Collection does not exist - [**MixedContentDataCollectionError**](/zh-cn/reference/errors/mixed-content-data-collection-error/)
Content and data cannot be in same collection. - [**ContentCollectionTypeMismatchError**](/zh-cn/reference/errors/content-collection-type-mismatch-error/)
Collection contains entries of a different type. - [**DataCollectionEntryParseError**](/zh-cn/reference/errors/data-collection-entry-parse-error/)
Data collection entry failed to parse. From 01b2485dae8944a0ac356cf4d66c1cf15588afa6 Mon Sep 17 00:00:00 2001 From: Nin3 <30520689+Nin3lee@users.noreply.github.com> Date: Tue, 3 Sep 2024 14:06:42 +0800 Subject: [PATCH 22/22] Update src/content/docs/zh-cn/reference/errors/actions-returned-invalid-data-error.mdx Co-authored-by: liruifengv --- .../reference/errors/actions-returned-invalid-data-error.mdx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/content/docs/zh-cn/reference/errors/actions-returned-invalid-data-error.mdx b/src/content/docs/zh-cn/reference/errors/actions-returned-invalid-data-error.mdx index 34e256a9698f2..4f1489cc766be 100644 --- a/src/content/docs/zh-cn/reference/errors/actions-returned-invalid-data-error.mdx +++ b/src/content/docs/zh-cn/reference/errors/actions-returned-invalid-data-error.mdx @@ -3,7 +3,6 @@ title: Action handler returned invalid data. i18nReady: true githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts --- -import DontEditWarning from '~/components/DontEditWarning.astro' > **ActionsReturnedInvalidDataError**: Action handler 返回了无效数据。handler 应该返回可序列化的数据类型,例如对象、数组、字符串和数字。解析错误:**错误**