Skip to content

i18n(zh-cn): Update error-reference.mdx & reference/errors/ #11537

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
May 5, 2025
8 changes: 6 additions & 2 deletions src/content/docs/zh-cn/reference/error-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/

## Astro 错误

- [**CantUseAstroConfigModuleError**](/zh-cn/reference/errors/cant-use-astro-config-module-error/)<br/>Cannot use the `astro:config` module without enabling the experimental feature.
- [**UnknownCompilerError**](/zh-cn/reference/errors/unknown-compiler-error/)<br/>Unknown compiler error.
- [**ClientAddressNotAvailable**](/zh-cn/reference/errors/client-address-not-available/)<br/>`Astro.clientAddress` is not available in current adapter.
- [**PrerenderClientAddressNotAvailable**](/zh-cn/reference/errors/prerender-client-address-not-available/)<br/>`Astro.clientAddress` cannot be used inside prerendered routes.
Expand Down Expand Up @@ -81,6 +80,11 @@ githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/
- [**RewriteWithBodyUsed**](/zh-cn/reference/errors/rewrite-with-body-used/)<br/>Cannot use Astro.rewrite after the request body has been read
- [**ForbiddenRewrite**](/zh-cn/reference/errors/forbidden-rewrite/)<br/>Forbidden rewrite to a static route.
- [**UnknownFilesystemError**](/zh-cn/reference/errors/unknown-filesystem-error/)<br/>An unknown error occurred while reading or writing files to disk.
- [**CannotExtractFontType**](/zh-cn/reference/errors/cannot-extract-font-type/)<br/>Cannot extract the font type from the given URL.
- [**CannotFetchFontFile**](/zh-cn/reference/errors/cannot-fetch-font-file/)<br/>Cannot fetch the given font file.
- [**CannotLoadFontProvider**](/zh-cn/reference/errors/cannot-load-font-provider/)<br/>Cannot load font provider
- [**ExperimentalFontsNotEnabled**](/zh-cn/reference/errors/experimental-fonts-not-enabled/)<br/>Experimental fonts are not enabled
- [**FontFamilyNotFound**](/zh-cn/reference/errors/font-family-not-found/)<br/>Font family not found

## CSS 错误

Expand Down Expand Up @@ -130,8 +134,8 @@ githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/

## Session(会话)错误

- [**SessionWithoutSupportedAdapterOutputError**](/zh-cn/reference/errors/session-without-supported-adapter-output-error/)<br/>Sessions cannot be used with an adapter that doesn't support server output.
- [**SessionStorageInitError**](/zh-cn/reference/errors/session-storage-init-error/)<br/>Session storage could not be initialized.
- [**SessionStorageSaveError**](/zh-cn/reference/errors/session-storage-save-error/)<br/>Session data could not be saved.
- [**SessionWithoutSupportedAdapterOutputError**](/zh-cn/reference/errors/session-without-supported-adapter-output-error/)<br/>Sessions cannot be used with an adapter that doesn't support server output.
- [**SessionConfigMissingError**](/zh-cn/reference/errors/session-config-missing-error/)<br/>Session storage was enabled but not configured.
- [**SessionConfigWithoutFlagError**](/zh-cn/reference/errors/session-config-without-flag-error/)<br/>Session flag not set
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: Cannot extract the font type from the given URL.
i18nReady: true
githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
---

> 当尝试从给定 URL 中提取该字体类型时,出现错误。

## 哪里出了问题?

无法从给定 URL 中提取该字体类型。
11 changes: 11 additions & 0 deletions src/content/docs/zh-cn/reference/errors/cannot-fetch-font-file.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: Cannot fetch the given font file.
i18nReady: true
githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
---

> 当尝试从给定 URL 中请求字体文件时,出现错误。

## 哪里出了问题?

无法获取给定的字体文件。
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: Cannot load font provider
i18nReady: true
githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
---

> Astro 无法加载给定的字体提供商。可在对应的字体提供商仓库中开启一个 issue。

## 哪里出了问题?

无法加载字体提供商。
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ i18nReady: true
githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
---

:::caution[已弃用]
该错误来自于旧版本的 Astro,目前已不再适用。如果你无法将自己的项目升级至最近的版本,你可以查看 [不再维护的旧版本文档快照](/zh-cn/upgrade-astro/#旧版本文档不再维护) 来获得帮助。
:::

> **CantUseAstroConfigModuleError**: 无法导入模块 "MODULE_NAME",因为实验性功能已禁用。在你的 `astro.config.mjs` 中启用 `experimental.serializeConfig`

## 哪里出了问题?
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: Experimental fonts are not enabled
i18nReady: true
githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
---

> **ExperimentalFontsNotEnabled**:使用了字体组件,但是实验性字体并没有在配置中注册。

## 哪里出了问题?

使用了字体组件,但实验性字体并未在配置中注册(启用)。
11 changes: 11 additions & 0 deletions src/content/docs/zh-cn/reference/errors/font-family-not-found.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: Font family not found
i18nReady: true
githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
---

> 在字体组件中,被传入的字体系列无数据。

## 哪里出了问题?

字体系列(font family)无数据。
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ i18nReady: true
githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
---

> `experimental.session` 标志被设置为 `true`,但没有配置存储。请要么手动配置存储,要么使用提供会话存储(session storage)的适配器
:::caution[已弃用]
该错误已在 Astro 5.7 中被移除,会话功能已不再是实验性功能。
:::

> `experimental.session` 标志被设置为 `true`,但没有配置存储。请要么手动配置存储,要么使用提供会话存储(session storage)的适配器。

## 哪里出了问题?
当启用会话存储但却未进行配置时,抛出错误。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ i18nReady: true
githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
---

> 在没有启用 `experimental.session` 标志的前提下提供了会话(session)配置。
:::caution[已弃用]
该错误已在 Astro 5.7 中被移除,会话功能已不再是实验性功能。
:::

> 在没有启用 `experimental.session` 标志的前提下提供了会话(Session)配置。

## 哪里出了问题?
在没有启用 `experimental.session` 标志却进行了会话存储配置时,抛出错误。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@ i18nReady: true
githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
---

:::caution[已弃用]
该错误已在 Astro 5.7 中被移除,会话功能已不再是实验性功能。
:::

> **SessionWithoutSupportedAdapterOutputError**: 会话(session)需要一个支持服务器输出的适配器。该适配器必须在其 `buildOutput` 功能中设置为 `"server"`。

## 哪里出了问题?
你的适配器必须支持服务器输出以使用会话。

**另见:**
- [服务器输出适配器构建](/zh-cn/reference/adapter-reference/#构建适配器)
- [Sessions](/zh-cn/guides/sessions/)