Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/content/docs/en/reference/error-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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/)<br/>Data collection entry failed to parse.
- [**DuplicateContentEntrySlugError**](/en/reference/errors/duplicate-content-entry-slug-error/)<br/>Duplicate content entry slug.
- [**UnsupportedConfigTransformError**](/en/reference/errors/unsupported-config-transform-error/)<br/>Unsupported transform in content config.
- [**FileParserNotFound**](/en/reference/errors/file-parser-not-found/)<br/>File parser not found
- [**FileGlobNotSupported**](/en/reference/errors/file-glob-not-supported/)<br/>Glob patterns are not supported in the file loader

## Action Errors

Expand Down
24 changes: 24 additions & 0 deletions src/content/docs/en/reference/errors/file-glob-not-supported.mdx
Original file line number Diff line number Diff line change
@@ -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 <DontEditWarning/> 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'

<DontEditWarning />


> **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)


24 changes: 24 additions & 0 deletions src/content/docs/en/reference/errors/file-parser-not-found.mdx
Original file line number Diff line number Diff line change
@@ -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 <DontEditWarning/> 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'

<DontEditWarning />


> **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)