diff --git a/src/content/docs/zh-cn/reference/error-reference.mdx b/src/content/docs/zh-cn/reference/error-reference.mdx index eeca0c850eeb4..494ca63f29518 100644 --- a/src/content/docs/zh-cn/reference/error-reference.mdx +++ b/src/content/docs/zh-cn/reference/error-reference.mdx @@ -86,6 +86,7 @@ githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/ - [**UnknownCSSError**](/zh-cn/reference/errors/unknown-csserror/)
Unknown CSS Error. - [**CSSSyntaxError**](/zh-cn/reference/errors/csssyntax-error/)
CSS Syntax Error. + ## Markdown 错误 - [**UnknownMarkdownError**](/zh-cn/reference/errors/unknown-markdown-error/)
Unknown Markdown Error. @@ -95,17 +96,20 @@ githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/ - [**UnknownConfigError**](/zh-cn/reference/errors/unknown-config-error/)
Unknown configuration error. - [**ConfigNotFound**](/zh-cn/reference/errors/config-not-found/)
Specified configuration file not found. - [**ConfigLegacyKey**](/zh-cn/reference/errors/config-legacy-key/)
Legacy configuration detected. + ## CLI 错误 - [**UnknownCLIError**](/zh-cn/reference/errors/unknown-clierror/)
Unknown CLI Error. - [**RenderUndefinedEntryError**](/zh-cn/reference/errors/render-undefined-entry-error/)
Attempted to render an undefined content collection entry. - [**GenerateContentTypesError**](/zh-cn/reference/errors/generate-content-types-error/)
Failed to generate content types. + ## 内容集合错误 - [**UnknownContentCollectionError**](/zh-cn/reference/errors/unknown-content-collection-error/)
Unknown Content Collection Error. - [**GetEntryDeprecationError**](/zh-cn/reference/errors/get-entry-deprecation-error/)
Invalid use of `getDataEntryById` or `getEntryBySlug` function. - [**InvalidContentEntryFrontmatterError**](/zh-cn/reference/errors/invalid-content-entry-frontmatter-error/)
Content entry frontmatter does not match schema. - [**InvalidContentEntryDataError**](/zh-cn/reference/errors/invalid-content-entry-data-error/)
Content entry data does not match schema. +- [**ContentLoaderReturnsInvalidId**](/zh-cn/reference/errors/content-loader-returns-invalid-id/)
Content loader returned an entry with an invalid `id`. - [**ContentEntryDataError**](/zh-cn/reference/errors/content-entry-data-error/)
Content entry data does not match schema. - [**ContentLoaderInvalidDataError**](/zh-cn/reference/errors/content-loader-invalid-data-error/)
Content entry is missing an ID - [**InvalidContentEntrySlugError**](/zh-cn/reference/errors/invalid-content-entry-slug-error/)
Invalid content entry slug. diff --git a/src/content/docs/zh-cn/reference/errors/content-loader-returns-invalid-id.mdx b/src/content/docs/zh-cn/reference/errors/content-loader-returns-invalid-id.mdx new file mode 100644 index 0000000000000..fc1fb362d221f --- /dev/null +++ b/src/content/docs/zh-cn/reference/errors/content-loader-returns-invalid-id.mdx @@ -0,0 +1,17 @@ +--- +title: Content loader returned an entry with an invalid id. +i18nReady: true +githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts +--- + +> **错误信息示例:**
+集合 **blog** 的内容加载器返回了一个具有无效 `id` 的条目:
+{
+ "id": 1,
+ "title": "Hello, World!"
+} + +## 哪里出了问题? +内容加载器返回了无效的 `id`。 +请确保条目的 `id` 为字符串。 +有关更多信息,请参阅 [内容集合文档](/zh-cn/guides/content-collections/)。