diff --git a/src/content/docs/zh-cn/reference/error-reference.mdx b/src/content/docs/zh-cn/reference/error-reference.mdx index 012c99a597d16..1411c0fba3099 100644 --- a/src/content/docs/zh-cn/reference/error-reference.mdx +++ b/src/content/docs/zh-cn/reference/error-reference.mdx @@ -81,6 +81,7 @@ githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/ - [**ForbiddenRewrite**](/zh-cn/reference/errors/forbidden-rewrite/)
Forbidden rewrite to a static route. - [**UnknownFilesystemError**](/zh-cn/reference/errors/unknown-filesystem-error/)
An unknown error occurred while reading or writing files to disk. - [**CannotExtractFontType**](/zh-cn/reference/errors/cannot-extract-font-type/)
Cannot extract the font type from the given URL. +- [**CannotDetermineWeightAndStyleFromFontFile**](/zh-cn/reference/errors/cannot-determine-weight-and-style-from-font-file/)
Cannot determine weight and style from font file. - [**CannotFetchFontFile**](/zh-cn/reference/errors/cannot-fetch-font-file/)
Cannot fetch the given font file. - [**CannotLoadFontProvider**](/zh-cn/reference/errors/cannot-load-font-provider/)
Cannot load font provider - [**ExperimentalFontsNotEnabled**](/zh-cn/reference/errors/experimental-fonts-not-enabled/)
Experimental fonts are not enabled @@ -123,6 +124,8 @@ githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/ - [**DataCollectionEntryParseError**](/zh-cn/reference/errors/data-collection-entry-parse-error/)
Data collection entry failed to parse. - [**DuplicateContentEntrySlugError**](/zh-cn/reference/errors/duplicate-content-entry-slug-error/)
Duplicate content entry slug. - [**UnsupportedConfigTransformError**](/zh-cn/reference/errors/unsupported-config-transform-error/)
Unsupported transform in content config. +- [**FileParserNotFound**](/zh-cn/reference/errors/file-parser-not-found/)
File parser not found +- [**FileGlobNotSupported**](/zh-cn/reference/errors/file-glob-not-supported/)
Glob patterns are not supported in the file loader ## Action 错误 diff --git a/src/content/docs/zh-cn/reference/errors/file-glob-not-supported.mdx b/src/content/docs/zh-cn/reference/errors/file-glob-not-supported.mdx new file mode 100644 index 0000000000000..39ab68e1296d4 --- /dev/null +++ b/src/content/docs/zh-cn/reference/errors/file-glob-not-supported.mdx @@ -0,0 +1,15 @@ +--- +title: Glob patterns are not supported in the file loader +i18nReady: true +githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts +--- + +> **FileGlobNotSupported**:在 `file` 加载器中,不支持 Glob 模式导入。请使用 `glob` 加载器替代。 + +## 哪里出了问题? + +`file` 加载器必须传入单个本地文件。其不支持 Glob 模式。使用内置的 `glob` 加载器以从多个本地文件的模式中创建条目。 + +**另见:** + +- [Astro 内置的加载器](/zh-cn/guides/content-collections/#内置的加载器) diff --git a/src/content/docs/zh-cn/reference/errors/file-parser-not-found.mdx b/src/content/docs/zh-cn/reference/errors/file-parser-not-found.mdx new file mode 100644 index 0000000000000..1dd6049556b5e --- /dev/null +++ b/src/content/docs/zh-cn/reference/errors/file-parser-not-found.mdx @@ -0,0 +1,15 @@ +--- +title: File parser not found +i18nReady: true +githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts +--- + +> **FileParserNotFound**:未找到'<文件_名称>'对应的解析器(parser)。请将解析器函数(例如:`parser: csv`)传入到 `file` 加载器中。 + +## 哪里出了问题? + +`file` 加载器无法确定需要使用哪个解析器。请提供一个自定义解析器(例如:`toml.parse` 或 `csv-parse`)用以从文件内容来创建集合。 + +**另见:** + +- [向 `file` 加载器传入 `parser`](/zh-cn/guides/content-collections/#parser-函数)