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
10 changes: 6 additions & 4 deletions src/content/docs/en/reference/error-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ The following reference is a complete list of the errors you may encounter while
- [**InvalidGetStaticPathsEntry**](/en/reference/errors/invalid-get-static-paths-entry/)<br/>Invalid entry inside getStaticPath's return value
- [**InvalidGetStaticPathsReturn**](/en/reference/errors/invalid-get-static-paths-return/)<br/>Invalid value returned by getStaticPaths.
- [**GetStaticPathsExpectedParams**](/en/reference/errors/get-static-paths-expected-params/)<br/>Missing params property on `getStaticPaths` route.
- [**GetStaticPathsInvalidRouteParam**](/en/reference/errors/get-static-paths-invalid-route-param/)<br/>Invalid value for `getStaticPaths` route parameter.
- [**GetStaticPathsInvalidRouteParam**](/en/reference/errors/get-static-paths-invalid-route-param/)<br/>Invalid route parameter returned by `getStaticPaths()`.
- [**GetStaticPathsRequired**](/en/reference/errors/get-static-paths-required/)<br/>`getStaticPaths()` function required for dynamic routes.
- [**ReservedSlotName**](/en/reference/errors/reserved-slot-name/)<br/>Invalid slot name.
- [**NoAdapterInstalled**](/en/reference/errors/no-adapter-installed/)<br/>Cannot use Server-side Rendering without an adapter.
Expand Down Expand Up @@ -80,6 +80,7 @@ The following reference is a complete list of the errors you may encounter while
- [**IncorrectStrategyForI18n**](/en/reference/errors/incorrect-strategy-for-i18n/)<br/>You can't use the current function with the current strategy
- [**NoPrerenderedRoutesWithDomains**](/en/reference/errors/no-prerendered-routes-with-domains/)<br/>Prerendered routes aren't supported when internationalization domains are enabled.
- [**MissingMiddlewareForInternationalization**](/en/reference/errors/missing-middleware-for-internationalization/)<br/>Enabled manual internationalization routing without having a middleware.
- [**InvalidI18nMiddlewareConfiguration**](/en/reference/errors/invalid-i18n-middleware-configuration/)<br/>Invalid internationalization middleware configuration
- [**CantRenderPage**](/en/reference/errors/cant-render-page/)<br/>Astro can't render the route.
- [**UnhandledRejection**](/en/reference/errors/unhandled-rejection/)<br/>Unhandled rejection
- [**i18nNotEnabled**](/en/reference/errors/i18n-not-enabled/)<br/>i18n Not Enabled
Expand All @@ -97,6 +98,7 @@ The following reference is a complete list of the errors you may encounter while
- [**ExperimentalFontsNotEnabled**](/en/reference/errors/experimental-fonts-not-enabled/)<br/>Experimental fonts are not enabled
- [**FontFamilyNotFound**](/en/reference/errors/font-family-not-found/)<br/>Font family not found
- [**CspNotEnabled**](/en/reference/errors/csp-not-enabled/)<br/>CSP feature isn't enabled
- [**UnavailableAstroGlobal**](/en/reference/errors/unavailable-astro-global/)<br/>Unavailable Astro global in getStaticPaths()

## CSS Errors

Expand Down Expand Up @@ -125,6 +127,9 @@ The following reference is a complete list of the errors you may encounter while
- [**GetEntryDeprecationError**](/en/reference/errors/get-entry-deprecation-error/)<br/>Invalid use of `getDataEntryById` or `getEntryBySlug` function.
- [**InvalidContentEntryFrontmatterError**](/en/reference/errors/invalid-content-entry-frontmatter-error/)<br/>Content entry frontmatter does not match schema.
- [**InvalidContentEntryDataError**](/en/reference/errors/invalid-content-entry-data-error/)<br/>Content entry data does not match schema.
- [**LegacyContentConfigError**](/en/reference/errors/legacy-content-config-error/)<br/>Legacy content config file found.
- [**ContentCollectionMissingLoader**](/en/reference/errors/content-collection-missing-loader/)<br/>Content collection is missing a `loader` definition.
- [**ContentCollectionInvalidType**](/en/reference/errors/content-collection-invalid-type/)<br/>Content collection has an invalid `type` field.
- [**ContentLoaderReturnsInvalidId**](/en/reference/errors/content-loader-returns-invalid-id/)<br/>Content loader returned an entry with an invalid `id`.
- [**ContentEntryDataError**](/en/reference/errors/content-entry-data-error/)<br/>Content entry data does not match schema.
- [**LiveContentConfigError**](/en/reference/errors/live-content-config-error/)<br/>Error in live content config.
Expand All @@ -151,7 +156,4 @@ The following reference is a complete list of the errors you may encounter while

- [**SessionStorageInitError**](/en/reference/errors/session-storage-init-error/)<br/>Session storage could not be initialized.
- [**SessionStorageSaveError**](/en/reference/errors/session-storage-save-error/)<br/>Session data could not be saved.
- [**SessionWithoutSupportedAdapterOutputError**](/en/reference/errors/session-without-supported-adapter-output-error/)<br/>Sessions cannot be used with an adapter that doesn't support server output.
- [**SessionConfigMissingError**](/en/reference/errors/session-config-missing-error/)<br/>Session storage was enabled but not configured.
- [**SessionConfigWithoutFlagError**](/en/reference/errors/session-config-without-flag-error/)<br/>Session flag not set
- [**CannotOptimizeSvg**](/en/reference/errors/cannot-optimize-svg/)<br/>Cannot optimize SVG
7 changes: 7 additions & 0 deletions src/content/docs/en/reference/errors/astro-glob-no-match.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,14 @@ import DontEditWarning from '~/components/DontEditWarning.astro'
<DontEditWarning />


:::caution[Deprecated]
This error was removed in Astro v6.0.0 along with the removal of `Astro.glob()`.
:::

> **AstroGlobNoMatch**: `Astro.glob(GLOB_STR)` did not return any matching files.

## What went wrong?
`Astro.glob()` did not return any matching files. There might be a typo in the glob pattern.



Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,14 @@ import DontEditWarning from '~/components/DontEditWarning.astro'
<DontEditWarning />


:::caution[Deprecated]
This error was removed in Astro v6.0.0 along with the removal of `Astro.glob()`.
:::

> **AstroGlobUsedOutside**: `Astro.glob(GLOB_STR)` can only be used in `.astro` files. `import.meta.glob(GLOB_STR)` can be used instead to achieve a similar result.

## What went wrong?
`Astro.glob()` can only be used in `.astro` files. You can use [`import.meta.glob()`](https://vite.dev/guide/features.html#glob-import) instead to achieve the same result.



Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,21 @@
# 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: Content collection invalid type.
title: Content collection has an invalid type field.
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 />


> Invalid collection type "data". Remove the type from your collection definition in your content config file.
> **Example error message:**<br/>
Invalid collection type "data". Remove the type from your collection definition in your content config file.

## What went wrong?
Content collections should no longer have a `type` field. Remove this field from your content config file.
See the [Astro 6 migration guide](https://v6.docs.astro.build/en/guides/upgrade-to/v6/#removed-legacy-content-collections) for more information.

### What went wrong?

Content collections should no longer have a type field. Remove this field from your content config file.

See the [Astro 6 migration guide](/en/guides/upgrade-to/v6/#removed-legacy-content-collections) for more information.
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@
# 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: Content collection missing loader.
title: Content collection is missing a loader definition.
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 />


> Collections must have a loader defined. Check your collection definitions in your content config file.
> **Example error message:**<br/>
Collections must have a `loader` defined. Check your collection definitions in your content config file.<br/>

## What went wrong?
A content collection is missing a `loader` definition. Make sure that each collection in your content config file has a `loader`.
See the [Content collections documentation](/en/guides/content-collections/) for more information.

### What went wrong?

A content collection is missing a loader definition. Make sure that each collection in your content config file has a loader.

**See Also:**
- [Content collections configuration](/en/guides/content-collections/)
2 changes: 1 addition & 1 deletion src/content/docs/en/reference/errors/csp-not-enabled.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import DontEditWarning from '~/components/DontEditWarning.astro'
<DontEditWarning />


> The `experimental.csp` configuration isn't enabled.
> The `security.csp` configuration isn't enabled.

## What went wrong?
The CSP feature isn't enabled
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ import DontEditWarning from '~/components/DontEditWarning.astro'
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 `file()` loader](/en/guides/content-collections/#the-file-loader)
- [Astro's built-in `file()` loader](/en/reference/content-loader-reference/#file-loader)


Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ import DontEditWarning from '~/components/DontEditWarning.astro'
The `file` loader can’t determine which parser to use. Please provide a custom parser (e.g. `csv-parse`) to create a collection from your file type.

**See Also:**
- [Passing a `parser` to the `file` loader](/en/reference/content-loader-reference/#parser)
- [Passing a `parser` to the `file` loader](https://v6.docs.astro.build/en/reference/content-loader-reference/#parser)


Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import DontEditWarning from '~/components/DontEditWarning.astro'
> **GetEntryDeprecationError**: The `METHOD` function is deprecated and cannot be used to query the "COLLECTION" collection. Use `getEntry` instead.

## What went wrong?
The `getDataEntryById` and `getEntryBySlug` functions are deprecated and cannot be used with content layer collections. Use the `getEntry` function instead.
The `getDataEntryById` and `getEntryBySlug` functions are deprecated and cannot be used with content collections. Use the `getEntry` function instead.



Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# 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: Invalid value for getStaticPaths route parameter.
title: Invalid route parameter returned by getStaticPaths().
i18nReady: true
githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
---
Expand All @@ -13,7 +13,7 @@ import DontEditWarning from '~/components/DontEditWarning.astro'
<DontEditWarning />


> **GetStaticPathsInvalidRouteParam**: Invalid getStaticPaths route parameter for `KEY`. Expected undefined, a string or a number, received `VALUE_TYPE` (`VALUE`)
> **GetStaticPathsInvalidRouteParam**: Invalid `getStaticPaths()` route parameter for `KEY`. Expected a string or undefined, received `VALUE_TYPE` (`VALUE`)

## What went wrong?
Since `params` are encoded into the URL, only certain types are supported as values.
Expand All @@ -23,8 +23,9 @@ Since `params` are encoded into the URL, only certain types are supported as val
export async function getStaticPaths() {
return [
{ params: { id: '1' } } // Works
{ params: { id: 2 } } // Works
{ params: { id: 2 } } // Does not work
{ params: { id: false } } // Does not work
{ params: { id: [1, 2] } } // Does not work
];
}
---
Expand All @@ -36,8 +37,8 @@ In routes using [rest parameters](/en/guides/routing/#rest-parameters), `undefin
---
export async function getStaticPaths() {
return [
{ params: { id: 1 } } // /route/1
{ params: { id: 2 } } // /route/2
{ params: { id: '1' } } // /route/1
{ params: { id: '2' } } // /route/2
{ params: { id: undefined } } // /route/
];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import DontEditWarning from '~/components/DontEditWarning.astro'


> **Example error message:**<br/>
**blog** → **post** frontmatter does not match collection schema.<br/>
**blog** → **post** data does not match collection schema.<br/>
"title" is required.<br/>
"date" must be a valid date.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ import DontEditWarning from '~/components/DontEditWarning.astro'
<DontEditWarning />


:::caution[Deprecated]
This error only applies to legacy content collections which were removed in Astro 6.
:::

> **Example error message:**<br/>
**blog** → **post.md** frontmatter does not match collection schema.<br/>
"title" is required.<br/>
Expand Down
4 changes: 4 additions & 0 deletions src/content/docs/en/reference/errors/invalid-glob.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ import DontEditWarning from '~/components/DontEditWarning.astro'
<DontEditWarning />


:::caution[Deprecated]
This error was removed in Astro v6.0.0 along with the removal of `Astro.glob()`.
:::

> **InvalidGlob**: Invalid glob pattern: `GLOB_PATTERN`. Glob patterns must start with './', '../' or '/'.

## What went wrong?
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
# 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: Invalid internationalization middleware configuration
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 />


> **InvalidI18nMiddlewareConfiguration**: The option `redirectToDefaultLocale` can be enabled only when `prefixDefaultLocale` is also set to `true`, otherwise redirects might cause infinite loops. Enable the option `prefixDefaultLocale` to continue to use `redirectToDefaultLocale`, or ensure both are set to `false`.

## What went wrong?
An invalid i18n middleware configuration was detected.



Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,21 @@
# 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: Legacy content config error.
title: Legacy content config file 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 />


> Legacy content config file found.

### What went wrong?
> **Example error message:**<br/>
Found legacy content config file in "src/content/config.ts". Please move this file to "src/content.config.ts" and ensure each collection has a loader defined.<br/>

## What went wrong?
A legacy content config file was found. Move the file to `src/content.config.ts` and update any collection definitions if needed.
See the [Astro 6 migration guide](https://v6.docs.astro.build/en/guides/upgrade-to/v6/#removed-legacy-content-collections) for more information.


See the [Astro 6 migration guide](/en/guides/upgrade-to/v6/#removed-legacy-content-collections) for more information.

**See Also:**
- [Content collections configuration](/en/guides/content-collections/#defining-build-time-content-collections)
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ The schema cannot be a function for live collections. Please use a schema object
Error in live content config.

**See Also:**
- [Live content collections](/en/guides/content-collections/#live-content-collections)
- [Defining live content schemas](https://v6.docs.astro.build/en/reference/modules/astro-content/#schema-1)


Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Two prerendered routes generate the same path, resulting in a collision.
A static path can only be generated by one route.

**See Also:**
- [`getStaticPaths()`](/en/reference/routing-reference/#getstaticpaths)
- [`params`](/en/reference/api-reference/#params)
- [Route Priority Order](/en/guides/routing/#route-priority-order)
- [`prerenderConflictBehavior`](/en/reference/configuration-reference/#prerenderconflictbehavior)


22 changes: 22 additions & 0 deletions src/content/docs/en/reference/errors/unavailable-astro-global.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
# 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: Unavailable Astro global in getStaticPaths()
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 />


> The Astro global is not available in getStaticPaths().

## What went wrong?
Unavailable Astro global in getStaticPaths