diff --git a/astro.sidebar.ts b/astro.sidebar.ts
index 2b2b98ce93c1d..5e8d9be3f437f 100644
--- a/astro.sidebar.ts
+++ b/astro.sidebar.ts
@@ -148,7 +148,6 @@ export const sidebar = [
'reference/experimental-flags/client-prerender',
'reference/experimental-flags/content-intellisense',
'reference/experimental-flags/chrome-devtools-workspace',
- 'reference/experimental-flags/fail-on-prerender-conflict',
],
}),
'reference/legacy-flags',
diff --git a/src/content/docs/en/guides/upgrade-to/v6.mdx b/src/content/docs/en/guides/upgrade-to/v6.mdx
index a96344079bc9d..59b159dff19e9 100644
--- a/src/content/docs/en/guides/upgrade-to/v6.mdx
+++ b/src/content/docs/en/guides/upgrade-to/v6.mdx
@@ -291,7 +291,6 @@ const { Content, headings } = await render(post);
See [the Astro v5 upgrade guide](/en/guides/upgrade-to/v5/#legacy-v20-content-collections-api) for previous guidance about backwards compatibility of legacy collections in Astro v5 and full step-by-step instructions for upgrading legacy collections to the new Content Layer API.
-
### Removed: `` component
@@ -554,7 +553,7 @@ Experimental flags allow you to opt in to features while they are in early devel
Remove these experimental flags from your Astro config if you were previously using them:
-```js del={5-8} title="astro.config.mjs"
+```js del={5-9} title="astro.config.mjs"
import { defineConfig } from 'astro/config';
export default defineConfig({
@@ -563,6 +562,7 @@ export default defineConfig({
preserveScriptOrder: true,
staticImportMetaEnv: true,
headingIdCompat: true,
+ failOnPrerenderConflict: true
},
})
```
@@ -570,6 +570,7 @@ export default defineConfig({
#### Experimental features now stable:
- `liveContentCollections` (See the updated [content collections docs](/en/guides/content-collections/) to learn more about live collections.)
+- `failOnPrerenderConflict` (See the new [`prerenderConflictBehavior`](/en/reference/configuration-reference/#prerenderconflictbehavior) configuration option.)
#### New default or recommended behavior:
@@ -579,7 +580,6 @@ export default defineConfig({
Read about exciting new features and more in [the v6.0 Blog post](https://astro.build/blog/astro-6/).
-
## Changed Defaults
Some default behavior has changed in Astro v5.0 and your project code may need updating to account for these changes.
diff --git a/src/content/docs/en/reference/configuration-reference.mdx b/src/content/docs/en/reference/configuration-reference.mdx
index c6dbc501e3452..ecc513b5d18da 100644
--- a/src/content/docs/en/reference/configuration-reference.mdx
+++ b/src/content/docs/en/reference/configuration-reference.mdx
@@ -366,6 +366,27 @@ Using `'class'` is helpful when you want to ensure that element selectors within
Using `'where'` gives you more control over specificity, but requires that you use higher-specificity selectors, layers, and other tools to control which selectors are applied.
Using `'attribute'` is useful when you are manipulating the `class` attribute of elements and need to avoid conflicts between your own styling logic and Astro's application of styles.
+### prerenderConflictBehavior
+
+
+
+**Type:** `'error' | 'warn' | 'ignore'`
+**Default:** `'warn'`
+
+
+
+Determines the default behavior when two routes generate the same prerendered URL:
+
+ - `error`: fail the build and display an error, forcing you to resolve the conflict
+ - `warn` (default): log a warning when conflicts occur, but build using the highest-priority route
+ - `ignore`: silently build using the highest-priority route when conflicts occur
+
+```js
+{
+ prerenderConflictBehavior: 'error'
+}
+```
+
### security
diff --git a/src/content/docs/en/reference/experimental-flags/fail-on-prerender-conflict.mdx b/src/content/docs/en/reference/experimental-flags/fail-on-prerender-conflict.mdx
deleted file mode 100644
index d55f79acbf8af..0000000000000
--- a/src/content/docs/en/reference/experimental-flags/fail-on-prerender-conflict.mdx
+++ /dev/null
@@ -1,37 +0,0 @@
----
-title: Experimental prerender conflict error
-sidebar:
- label: Prerender conflict error
-i18nReady: true
----
-
-import Since from '~/components/Since.astro'
-
-
-
-**Type:** `boolean`
-**Default:** `false`
-
-
-
-Turns prerender conflict warnings into errors during the build process.
-
-Astro currently warns you during the build about any conflicts between multiple dynamic routes that can result in the same output path. For example `/blog/[slug]` and `/blog/[...all]` both could try to prerender the `/blog/post-1` path. In such cases, Astro renders only the [highest priority route](/en/guides/routing/#route-priority-order) for the conflicting path. This allows your site to build successfully, although you may discover that some pages are rendered by unexpected routes.
-
-With this experimental flag set, the build will instead fail immediately with an error. This will require you to resolve any routing conflicts immediately, and will ensure that Astro is building your routes as you intend.
-
-To enable this behavior, add the `experimental.failOnPrerenderConflict` feature flag to your Astro config:
-
-```js title="astro.config.mjs" ins={4-6}
-import { defineConfig } from "astro/config"
-
-defineConfig({
- experimental: {
- failOnPrerenderConflict: true,
- },
-});
-```
-
-## Usage
-
-After enabling this flag, you may encounter errors about conflicting prerendered routes when you attempt to build your project. If this happens, you will need to update one or more of your [dynamic routes](/en/guides/routing/#dynamic-routes) to avoid ambiguous routing.
diff --git a/src/content/docs/fr/reference/experimental-flags/fail-on-prerender-conflict.mdx b/src/content/docs/fr/reference/experimental-flags/fail-on-prerender-conflict.mdx
deleted file mode 100644
index 77c9d8081d446..0000000000000
--- a/src/content/docs/fr/reference/experimental-flags/fail-on-prerender-conflict.mdx
+++ /dev/null
@@ -1,37 +0,0 @@
----
-title: Erreur de conflit de pré-rendu expérimentale
-sidebar:
- label: Erreur de conflit de pré-rendu
-i18nReady: true
----
-
-import Since from '~/components/Since.astro'
-
-
-
-**Type :** `boolean`
-**Par défaut :** `false`
-
-
-
-Transforme les avertissements de conflit de pré-rendu en erreurs pendant le processus de compilation.
-
-Astro vous avertit actuellement, lors de la compilation, de tout conflit entre plusieurs routes dynamiques pouvant générer le même chemin de sortie. Par exemple, `/blog/[slug]` et `/blog/[...all]` pourraient tous deux tenter de générer le chemin `/blog/article-1`. Dans ce cas, Astro génère uniquement la [route la plus prioritaire](/fr/guides/routing/#ordre-de-priorité-des-routes) pour le chemin en conflit. Cela permet à votre site d'être compilé correctement, même si vous pourriez constater que certaines pages sont générées par des routes inattendues.
-
-Avec cette option expérimentale, la compilation échouera immédiatement avec une erreur. Cela vous obligera à résoudre immédiatement tout conflit de routage et garantira qu'Astro génère vos routes comme prévu.
-
-Pour activer ce comportement, ajoutez l'option de fonctionnalité `experimental.failOnPrerenderConflict` à votre configuration Astro :
-
-```js title="astro.config.mjs" ins={4-6}
-import { defineConfig } from "astro/config"
-
-defineConfig({
- experimental: {
- failOnPrerenderConflict: true,
- },
-});
-```
-
-## Utilisation
-
-Après avoir activé cette option, vous risquez de rencontrer des erreurs concernant des routes pré-rendues en conflit lorsque vous tentez de compiler votre projet. Si cela se produit, vous devrez mettre à jour une ou plusieurs de vos [routes dynamiques](/fr/guides/routing/#routes-dynamiques) pour éviter tout routage ambigu.
diff --git a/src/content/docs/ko/reference/experimental-flags/fail-on-prerender-conflict.mdx b/src/content/docs/ko/reference/experimental-flags/fail-on-prerender-conflict.mdx
deleted file mode 100644
index da18e2d2e6a5b..0000000000000
--- a/src/content/docs/ko/reference/experimental-flags/fail-on-prerender-conflict.mdx
+++ /dev/null
@@ -1,37 +0,0 @@
----
-title: 실험적 사전 렌더링 충돌 오류
-sidebar:
- label: 사전 렌더링 충돌 오류
-i18nReady: true
----
-
-import Since from '~/components/Since.astro'
-
-
-
-**타입:** `boolean`
-**기본값:** `false`
-
-
-
-빌드 과정에서 사전 렌더링 충돌 경고를 오류로 전환합니다.
-
-Astro는 빌드 과정에서 동일한 출력 경로를 생성할 수 있는 여러 동적 라우트 간 충돌에 대해 경고합니다. 예를 들어 `/blog/[slug]`와 `/blog/[...all]` 모두 `/blog/post-1` 경로를 사전 렌더링하려고 시도합니다. 이러한 경우 Astro는 충돌하는 경로에 대해 [가장 높은 우선순위의 라우트](/ko/guides/routing/#라우트-우선-순위)만 렌더링합니다. 이를 통해 사이트는 성공적으로 빌드되지만, 일부 페이지가 예상치 못한 라우트로 렌더링된다는 사실을 발견할 수 있습니다.
-
-이 실험적 플래그가 설정되면, 빌드는 즉시 실패하며, 오류가 발생합니다. 이로 인해 라우팅 충돌을 즉시 해결해야 하며, Astro가 라우트를 의도한 대로 빌드하도록 보장합니다.
-
-이 동작을 활성화하려면 Astro 구성에 `experimental.failOnPrerenderConflict` 기능 플래그를 추가하세요.
-
-```js title="astro.config.mjs" ins={4-6}
-import { defineConfig } from "astro/config"
-
-defineConfig({
- experimental: {
- failOnPrerenderConflict: true,
- },
-});
-```
-
-## 사용하기
-
-이 플래그를 활성화한 후에는 프로젝트 빌드 시 사전 렌더링된 라우트 충돌에 대한 오류가 발생할 수 있습니다. 이 경우 모호한 라우팅을 방지하기 위해 하나 이상의 [동적 라우트](/ko/guides/routing/#동적-라우트)를 업데이트해야 합니다.