diff --git a/src/content/docs/en/reference/error-reference.mdx b/src/content/docs/en/reference/error-reference.mdx index 674e5a68206cf..3c63160754e74 100644 --- a/src/content/docs/en/reference/error-reference.mdx +++ b/src/content/docs/en/reference/error-reference.mdx @@ -133,6 +133,8 @@ The following reference is a complete list of the errors you may encounter while - [**DataCollectionEntryParseError**](/en/reference/errors/data-collection-entry-parse-error/)
Data collection entry failed to parse. - [**DuplicateContentEntrySlugError**](/en/reference/errors/duplicate-content-entry-slug-error/)
Duplicate content entry slug. - [**UnsupportedConfigTransformError**](/en/reference/errors/unsupported-config-transform-error/)
Unsupported transform in content config. +- [**FileParserNotFound**](/en/reference/errors/file-parser-not-found/)
File parser not found +- [**FileGlobNotSupported**](/en/reference/errors/file-glob-not-supported/)
Glob patterns are not supported in the file loader ## Action Errors diff --git a/src/content/docs/en/reference/errors/file-glob-not-supported.mdx b/src/content/docs/en/reference/errors/file-glob-not-supported.mdx new file mode 100644 index 0000000000000..9918fdd56ccb5 --- /dev/null +++ b/src/content/docs/en/reference/errors/file-glob-not-supported.mdx @@ -0,0 +1,24 @@ +--- +# NOTE: This file is auto-generated from 'scripts/error-docgen.mjs' +# Do not make edits to it directly, they will be overwritten. +# Instead, change this file: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts +# Translators, please remove this note and the component. + +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 +--- +import DontEditWarning from '~/components/DontEditWarning.astro' + + + + +> **FileGlobNotSupported**: Glob patterns are not supported in the `file` loader. Use the `glob` loader instead. + +## What went wrong? +The `file` loader must be passed a single local file. Glob patterns are not supported. Use the built-in `glob` loader to create entries from patterns of multiple local files. + +**See Also:** +- [Astro's built-in loaders](/en/guides/content-collections/#built-in-loaders) + + diff --git a/src/content/docs/en/reference/errors/file-parser-not-found.mdx b/src/content/docs/en/reference/errors/file-parser-not-found.mdx new file mode 100644 index 0000000000000..5ec4611ab7310 --- /dev/null +++ b/src/content/docs/en/reference/errors/file-parser-not-found.mdx @@ -0,0 +1,24 @@ +--- +# NOTE: This file is auto-generated from 'scripts/error-docgen.mjs' +# Do not make edits to it directly, they will be overwritten. +# Instead, change this file: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts +# Translators, please remove this note and the component. + +title: File parser 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' + + + + +> **FileParserNotFound**: No parser was found for 'FILE_NAME'. Pass a parser function (e.g. `parser: csv`) to the `file` loader. + +## What went wrong? +The `file` loader can’t determine which parser to use. Please provide a custom parser (e.g. `toml.parse` or `csv-parse`) to create a collection from your file type. + +**See Also:** +- [Passing a `parser` to the `file` loader](/en/guides/content-collections/#parser-function) + +