diff --git a/src/content/docs/zh-cn/reference/error-reference.mdx b/src/content/docs/zh-cn/reference/error-reference.mdx index 2492135a82136..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. @@ -115,6 +110,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. -- [**ActionQueryStringInvalidError**](/zh-cn/reference/errors/action-query-string-invalid-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. +- [**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. 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) 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..075a56150926d --- /dev/null +++ b/src/content/docs/zh-cn/reference/errors/action-not-found-error.mdx @@ -0,0 +1,10 @@ +--- +title: Action not found. +i18nReady: true +githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts +--- + +> **ActionNotFoundError**: 服务器接收到一个名为 `ACTION_NAME` 的 action 请求,但找不到匹配项。如果你重命名了 action,请检查你是否已经更新为匹配的 `actions/index` 文件和调用代码。 + +## 哪里出了问题? +服务器接收到了 action 的请求,但是无法找到同名的匹配项。 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..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 @@ -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 中删除此查询参数并刷新。 ## 哪里出了问题? 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..4f1489cc766be --- /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 +--- + +> **ActionsReturnedInvalidDataError**: Action handler 返回了无效数据。handler 应该返回可序列化的数据类型,例如对象、数组、字符串和数字。解析错误:**错误** + +## 哪里出了问题? +Action handler 返回了无效数据。handler 应该返回可序列化的数据类型,并且不能返回 Response 对象。 + +**另请参阅:** +- [Actions handler 参考](/zh-cn/reference/api-reference/#handler-属性) 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..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 @@ -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 类型 ## 发生了什么错误? 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..c531e48607dbb 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。 ## 发生了什么错误? 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..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 @@ -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) ## 哪里发生了错误? 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" 字段。