diff --git a/src/content/docs/en/reference/error-reference.mdx b/src/content/docs/en/reference/error-reference.mdx index f0812d9c5e55c..5e6a2d821bd9b 100644 --- a/src/content/docs/en/reference/error-reference.mdx +++ b/src/content/docs/en/reference/error-reference.mdx @@ -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/)
Invalid entry inside getStaticPath's return value - [**InvalidGetStaticPathsReturn**](/en/reference/errors/invalid-get-static-paths-return/)
Invalid value returned by getStaticPaths. - [**GetStaticPathsExpectedParams**](/en/reference/errors/get-static-paths-expected-params/)
Missing params property on `getStaticPaths` route. -- [**GetStaticPathsInvalidRouteParam**](/en/reference/errors/get-static-paths-invalid-route-param/)
Invalid value for `getStaticPaths` route parameter. +- [**GetStaticPathsInvalidRouteParam**](/en/reference/errors/get-static-paths-invalid-route-param/)
Invalid route parameter returned by `getStaticPaths()`. - [**GetStaticPathsRequired**](/en/reference/errors/get-static-paths-required/)
`getStaticPaths()` function required for dynamic routes. - [**ReservedSlotName**](/en/reference/errors/reserved-slot-name/)
Invalid slot name. - [**NoAdapterInstalled**](/en/reference/errors/no-adapter-installed/)
Cannot use Server-side Rendering without an adapter. @@ -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/)
You can't use the current function with the current strategy - [**NoPrerenderedRoutesWithDomains**](/en/reference/errors/no-prerendered-routes-with-domains/)
Prerendered routes aren't supported when internationalization domains are enabled. - [**MissingMiddlewareForInternationalization**](/en/reference/errors/missing-middleware-for-internationalization/)
Enabled manual internationalization routing without having a middleware. +- [**InvalidI18nMiddlewareConfiguration**](/en/reference/errors/invalid-i18n-middleware-configuration/)
Invalid internationalization middleware configuration - [**CantRenderPage**](/en/reference/errors/cant-render-page/)
Astro can't render the route. - [**UnhandledRejection**](/en/reference/errors/unhandled-rejection/)
Unhandled rejection - [**i18nNotEnabled**](/en/reference/errors/i18n-not-enabled/)
i18n Not Enabled @@ -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/)
Experimental fonts are not enabled - [**FontFamilyNotFound**](/en/reference/errors/font-family-not-found/)
Font family not found - [**CspNotEnabled**](/en/reference/errors/csp-not-enabled/)
CSP feature isn't enabled +- [**UnavailableAstroGlobal**](/en/reference/errors/unavailable-astro-global/)
Unavailable Astro global in getStaticPaths() ## CSS Errors @@ -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/)
Invalid use of `getDataEntryById` or `getEntryBySlug` function. - [**InvalidContentEntryFrontmatterError**](/en/reference/errors/invalid-content-entry-frontmatter-error/)
Content entry frontmatter does not match schema. - [**InvalidContentEntryDataError**](/en/reference/errors/invalid-content-entry-data-error/)
Content entry data does not match schema. +- [**LegacyContentConfigError**](/en/reference/errors/legacy-content-config-error/)
Legacy content config file found. +- [**ContentCollectionMissingLoader**](/en/reference/errors/content-collection-missing-loader/)
Content collection is missing a `loader` definition. +- [**ContentCollectionInvalidType**](/en/reference/errors/content-collection-invalid-type/)
Content collection has an invalid `type` field. - [**ContentLoaderReturnsInvalidId**](/en/reference/errors/content-loader-returns-invalid-id/)
Content loader returned an entry with an invalid `id`. - [**ContentEntryDataError**](/en/reference/errors/content-entry-data-error/)
Content entry data does not match schema. - [**LiveContentConfigError**](/en/reference/errors/live-content-config-error/)
Error in live content config. @@ -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/)
Session storage could not be initialized. - [**SessionStorageSaveError**](/en/reference/errors/session-storage-save-error/)
Session data could not be saved. -- [**SessionWithoutSupportedAdapterOutputError**](/en/reference/errors/session-without-supported-adapter-output-error/)
Sessions cannot be used with an adapter that doesn't support server output. -- [**SessionConfigMissingError**](/en/reference/errors/session-config-missing-error/)
Session storage was enabled but not configured. -- [**SessionConfigWithoutFlagError**](/en/reference/errors/session-config-without-flag-error/)
Session flag not set - [**CannotOptimizeSvg**](/en/reference/errors/cannot-optimize-svg/)
Cannot optimize SVG diff --git a/src/content/docs/en/reference/errors/astro-glob-no-match.mdx b/src/content/docs/en/reference/errors/astro-glob-no-match.mdx index e0f6b9d83d6b6..0e45b66b2a692 100644 --- a/src/content/docs/en/reference/errors/astro-glob-no-match.mdx +++ b/src/content/docs/en/reference/errors/astro-glob-no-match.mdx @@ -13,7 +13,14 @@ import DontEditWarning from '~/components/DontEditWarning.astro' +:::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. + + + diff --git a/src/content/docs/en/reference/errors/astro-glob-used-outside.mdx b/src/content/docs/en/reference/errors/astro-glob-used-outside.mdx index f3473054c151f..6aae23f28cf09 100644 --- a/src/content/docs/en/reference/errors/astro-glob-used-outside.mdx +++ b/src/content/docs/en/reference/errors/astro-glob-used-outside.mdx @@ -13,7 +13,14 @@ import DontEditWarning from '~/components/DontEditWarning.astro' +:::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. + + + diff --git a/src/content/docs/en/reference/errors/content-collection-invalid-type.mdx b/src/content/docs/en/reference/errors/content-collection-invalid-type.mdx index 79332174c63d2..af57b12835bd7 100644 --- a/src/content/docs/en/reference/errors/content-collection-invalid-type.mdx +++ b/src/content/docs/en/reference/errors/content-collection-invalid-type.mdx @@ -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 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' -> Invalid collection type "data". Remove the type from your collection definition in your content config file. +> **Example error message:**
+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. \ No newline at end of file diff --git a/src/content/docs/en/reference/errors/content-collection-missing-loader.mdx b/src/content/docs/en/reference/errors/content-collection-missing-loader.mdx index 13652a54399f6..81c3e4c3ecd7c 100644 --- a/src/content/docs/en/reference/errors/content-collection-missing-loader.mdx +++ b/src/content/docs/en/reference/errors/content-collection-missing-loader.mdx @@ -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 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' -> Collections must have a loader defined. Check your collection definitions in your content config file. +> **Example error message:**
+Collections must have a `loader` defined. Check your collection definitions in your content config file.
+ +## 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/) diff --git a/src/content/docs/en/reference/errors/csp-not-enabled.mdx b/src/content/docs/en/reference/errors/csp-not-enabled.mdx index 244ac07ec9f23..324da2e52517d 100644 --- a/src/content/docs/en/reference/errors/csp-not-enabled.mdx +++ b/src/content/docs/en/reference/errors/csp-not-enabled.mdx @@ -13,7 +13,7 @@ import DontEditWarning from '~/components/DontEditWarning.astro' -> The `experimental.csp` configuration isn't enabled. +> The `security.csp` configuration isn't enabled. ## What went wrong? The CSP feature isn't enabled 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 index be9f4ce3a5767..6dffa461557a1 100644 --- a/src/content/docs/en/reference/errors/file-glob-not-supported.mdx +++ b/src/content/docs/en/reference/errors/file-glob-not-supported.mdx @@ -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) 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 index 5d614b41dee66..12441afb0ac61 100644 --- a/src/content/docs/en/reference/errors/file-parser-not-found.mdx +++ b/src/content/docs/en/reference/errors/file-parser-not-found.mdx @@ -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) diff --git a/src/content/docs/en/reference/errors/get-entry-deprecation-error.mdx b/src/content/docs/en/reference/errors/get-entry-deprecation-error.mdx index f6d9f05156c8e..72728c500b4ce 100644 --- a/src/content/docs/en/reference/errors/get-entry-deprecation-error.mdx +++ b/src/content/docs/en/reference/errors/get-entry-deprecation-error.mdx @@ -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. diff --git a/src/content/docs/en/reference/errors/get-static-paths-invalid-route-param.mdx b/src/content/docs/en/reference/errors/get-static-paths-invalid-route-param.mdx index cee383760cd45..f8eca93ebae3d 100644 --- a/src/content/docs/en/reference/errors/get-static-paths-invalid-route-param.mdx +++ b/src/content/docs/en/reference/errors/get-static-paths-invalid-route-param.mdx @@ -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 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 --- @@ -13,7 +13,7 @@ import DontEditWarning from '~/components/DontEditWarning.astro' -> **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. @@ -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 ]; } --- @@ -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/ ]; } diff --git a/src/content/docs/en/reference/errors/invalid-content-entry-data-error.mdx b/src/content/docs/en/reference/errors/invalid-content-entry-data-error.mdx index 69f765d1235d5..c3e35af3641cd 100644 --- a/src/content/docs/en/reference/errors/invalid-content-entry-data-error.mdx +++ b/src/content/docs/en/reference/errors/invalid-content-entry-data-error.mdx @@ -14,7 +14,7 @@ import DontEditWarning from '~/components/DontEditWarning.astro' > **Example error message:**
-**blog** → **post** frontmatter does not match collection schema.
+**blog** → **post** data does not match collection schema.
"title" is required.
"date" must be a valid date. diff --git a/src/content/docs/en/reference/errors/invalid-content-entry-frontmatter-error.mdx b/src/content/docs/en/reference/errors/invalid-content-entry-frontmatter-error.mdx index 19c3ca122fd7d..909063a703402 100644 --- a/src/content/docs/en/reference/errors/invalid-content-entry-frontmatter-error.mdx +++ b/src/content/docs/en/reference/errors/invalid-content-entry-frontmatter-error.mdx @@ -13,6 +13,10 @@ import DontEditWarning from '~/components/DontEditWarning.astro' +:::caution[Deprecated] +This error only applies to legacy content collections which were removed in Astro 6. +::: + > **Example error message:**
**blog** → **post.md** frontmatter does not match collection schema.
"title" is required.
diff --git a/src/content/docs/en/reference/errors/invalid-glob.mdx b/src/content/docs/en/reference/errors/invalid-glob.mdx index a6cfea8df3bac..d0452510ed6eb 100644 --- a/src/content/docs/en/reference/errors/invalid-glob.mdx +++ b/src/content/docs/en/reference/errors/invalid-glob.mdx @@ -13,6 +13,10 @@ import DontEditWarning from '~/components/DontEditWarning.astro' +:::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? diff --git a/src/content/docs/en/reference/errors/invalid-i18n-middleware-configuration.mdx b/src/content/docs/en/reference/errors/invalid-i18n-middleware-configuration.mdx new file mode 100644 index 0000000000000..aca71d0899e37 --- /dev/null +++ b/src/content/docs/en/reference/errors/invalid-i18n-middleware-configuration.mdx @@ -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 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' + + + + +> **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. + + + diff --git a/src/content/docs/en/reference/errors/legacy-content-config-error.mdx b/src/content/docs/en/reference/errors/legacy-content-config-error.mdx index 0386c68efce2d..cc0ef66b4fadd 100644 --- a/src/content/docs/en/reference/errors/legacy-content-config-error.mdx +++ b/src/content/docs/en/reference/errors/legacy-content-config-error.mdx @@ -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 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' -> Legacy content config file found. - -### What went wrong? +> **Example error message:**
+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.
+## 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) diff --git a/src/content/docs/en/reference/errors/live-content-config-error.mdx b/src/content/docs/en/reference/errors/live-content-config-error.mdx index e8b5edb90662f..d7a82575cae63 100644 --- a/src/content/docs/en/reference/errors/live-content-config-error.mdx +++ b/src/content/docs/en/reference/errors/live-content-config-error.mdx @@ -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) diff --git a/src/content/docs/en/reference/errors/prerender-route-conflict.mdx b/src/content/docs/en/reference/errors/prerender-route-conflict.mdx index f706b6021c0b3..a74901f5cee29 100644 --- a/src/content/docs/en/reference/errors/prerender-route-conflict.mdx +++ b/src/content/docs/en/reference/errors/prerender-route-conflict.mdx @@ -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) diff --git a/src/content/docs/en/reference/errors/unavailable-astro-global.mdx b/src/content/docs/en/reference/errors/unavailable-astro-global.mdx new file mode 100644 index 0000000000000..f98a54926ee92 --- /dev/null +++ b/src/content/docs/en/reference/errors/unavailable-astro-global.mdx @@ -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 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' + + + + +> The Astro global is not available in getStaticPaths(). + +## What went wrong? +Unavailable Astro global in getStaticPaths + + +