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
1 change: 1 addition & 0 deletions src/content/docs/en/reference/error-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ The following reference is a complete list of the errors you may encounter while
- [**i18nNoLocaleFoundInPath**](/en/reference/errors/i18n-no-locale-found-in-path/)<br/>The path doesn't contain any locale
- [**RouteNotFound**](/en/reference/errors/route-not-found/)<br/>Route not found.
- [**EnvInvalidVariables**](/en/reference/errors/env-invalid-variables/)<br/>Invalid Environment Variables
- [**EnvPrefixConflictsWithSecret**](/en/reference/errors/env-prefix-conflicts-with-secret/)<br/>envPrefix conflicts with secret environment variables
- [**ServerOnlyModule**](/en/reference/errors/server-only-module/)<br/>Module is only available server-side
- [**RewriteWithBodyUsed**](/en/reference/errors/rewrite-with-body-used/)<br/>Cannot use Astro.rewrite after the request body has been read
- [**ForbiddenRewrite**](/en/reference/errors/forbidden-rewrite/)<br/>Forbidden rewrite to a static route.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
# 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: envPrefix conflicts with secret environment variables
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 />


> **EnvPrefixConflictsWithSecret**: The following environment variables are declared with `access: "secret"` in `env.schema`, but their names match a prefix in `vite.envPrefix`, which would expose them in client-side bundles:<br/><br/>CONFLICTS.MAP((C) =\ >`- ${C`).join('<br/>')}<br/><br/>Either remove the conflicting prefixes from `vite.envPrefix`, or rename these variables to use a prefix not in `vite.envPrefix`.

## What went wrong?
The configured `vite.envPrefix` includes prefixes that match environment variables declared with `access: "secret"` in `env.schema`.
This would cause Vite to expose those secret values in client-side JavaScript bundles, bypassing the `access: "secret"` protection.

To fix this, either:
- Remove the conflicting prefixes from `vite.envPrefix`, or
- Rename your secret environment variables to use a prefix that is not in `vite.envPrefix`.



2 changes: 1 addition & 1 deletion src/content/docs/en/reference/errors/forbidden-rewrite.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import DontEditWarning from '~/components/DontEditWarning.astro'


> **ForbiddenRewrite**: You tried to rewrite the on-demand route 'FROM' with the static route 'TO', when using the 'server' output. <br/><br/>The static route 'TO' is rendered by the component
'COMPONENT', which is marked as prerendered. This is a forbidden operation because during the build the component 'COMPONENT' is compiled to an
'COMPONENT', which is marked as prerendered. This is a forbidden operation because during the build, the component 'COMPONENT' is compiled to an
HTML file, which can't be retrieved at runtime by Astro.

## What went wrong?
Expand Down
4 changes: 2 additions & 2 deletions src/content/docs/en/reference/errors/i18n-not-enabled.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import DontEditWarning from '~/components/DontEditWarning.astro'
<DontEditWarning />


> **i18nNotEnabled**: The `astro:i18n` module can not be used without enabling i18n in your Astro config.
> **i18nNotEnabled**: The `astro:i18n` module cannot be used without enabling i18n in your Astro config.

## What went wrong?
The `astro:i18n` module can not be used without enabling i18n in your Astro config. To enable i18n, add a default locale and a list of supported locales to your Astro config:
The `astro:i18n` module cannot be used without enabling i18n in your Astro config. To enable i18n, add a default locale and a list of supported locales to your Astro config:
```js
import { defineConfig } from 'astro'
export default defineConfig({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ 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`.
> **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.
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/en/reference/errors/locals-reassigned.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import DontEditWarning from '~/components/DontEditWarning.astro'
<DontEditWarning />


> **LocalsReassigned**: `locals` can not be assigned directly.
> **LocalsReassigned**: `locals` cannot be assigned directly.

## What went wrong?
Thrown when a value is being set as the `locals` field on the Astro global or context.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import DontEditWarning from '~/components/DontEditWarning.astro'


> **Example error messages:**<br/>
can not read an implicit mapping pair; a colon is missed<br/>
cannot read an implicit mapping pair; a colon is missed<br/>
unexpected end of the stream within a double quoted scalar<br/>
can not read a block mapping entry; a multiline key may not be an implicit key
cannot read a block mapping entry; a multiline key may not be an implicit key

## What went wrong?
Astro encountered an error while parsing the frontmatter of your Markdown file.
Expand Down