Skip to content

Overhaul errors for consistency and correctness#16593

Merged
matthewp merged 14 commits into
mainfrom
errors-fix
May 18, 2026
Merged

Overhaul errors for consistency and correctness#16593
matthewp merged 14 commits into
mainfrom
errors-fix

Conversation

@yanthomasdev

Copy link
Copy Markdown
Member

Changes

This PR does an overhaul of all error messages to make them more consistent with each other, namely:

  • fixing missing full stop at the end of messages.
  • adding missing backticks to code excerpts.
  • adding () to differentiate functions from simple properties/objects.
  • improving error titles/messages with more context.

Testing

I am not sure if adding backticks in a few places could break rendering, we'll be sure once we get the automated PR on docs.

Docs

That's all it is.

@changeset-bot

changeset-bot Bot commented May 4, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: dd42e62

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions Bot added pkg: astro Related to the core `astro` package (scope) docs pr labels May 4, 2026
@codspeed-hq

codspeed-hq Bot commented May 4, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 10.51%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 1 improved benchmark
✅ 17 untouched benchmarks

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation Build: hybrid site (static + server) 10.6 s 9.6 s +10.51%

Comparing errors-fix (dd42e62) with main (272185b)

Open in CodSpeed

@ArmandPhilippot ArmandPhilippot left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I left some suggestions but none related to your changes (I spotted a few broken links).

But it seems you'll need to also update some tests because of the renamed errors (capitalization > tests failures).

Comment thread packages/astro/src/core/errors/errors-data.ts Outdated
Comment thread packages/astro/src/core/errors/errors-data.ts Outdated
* - [Dynamic Routes](https://docs.astro.build/en/guides/routing/#dynamic-routes)
* - [`getStaticPaths()`](https://docs.astro.build/en/reference/routing-reference/#getstaticpaths)
* - [Server-side Rendering](https://docs.astro.build/en/guides/on-demand-rendering/)
* - [Server-side rendering](https://docs.astro.build/en/guides/on-demand-rendering/)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should take this opportunity to adjust the wording for consistency:

-Server-side rendering
+On-demand rendering

But this is used in several places so it might be easier to check the occurrence in an editor. That's said, this can also happen another time. Just a though while reviewing!

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True! I had that planned as a follow-up but forgot to mention in the PR description

yanthomasdev and others added 3 commits May 4, 2026 16:48

@ArmandPhilippot ArmandPhilippot left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about the view transition test, but core-image.test.ts is flaky! I had to rerun the test a few times this morning to merge a docs-only PR. So, LGTM! Thank you!

@delucis delucis left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly looks great — @yanthomasdev! Just one comment.

Comment thread packages/astro/src/core/errors/errors-data.ts Outdated
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
Comment thread packages/astro/src/core/errors/errors-data.ts Outdated
@matthewp matthewp merged commit 50924ce into main May 18, 2026
27 checks passed
@matthewp matthewp deleted the errors-fix branch May 18, 2026 16:40
@astrobot-houston astrobot-houston mentioned this pull request May 18, 2026
ematipico pushed a commit that referenced this pull request May 20, 2026
* Overhaul errors for consistency and correctness

* Add changeset

* wrong package, lol

* Apply Armand's fixes

Co-authored-by: Armand Philippot <git@armand.philippot.eu>

* fix error messages in tests

* Update packages/astro/src/core/errors/errors-data.ts

Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>

* Update packages/astro/src/core/errors/errors-data.ts

---------

Co-authored-by: Armand Philippot <git@armand.philippot.eu>
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
dadezzz pushed a commit to dadezzz/university_notes that referenced this pull request May 22, 2026
This PR contains the following updates:

| Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [astro](https://astro.build) ([source](https://github.com/withastro/astro/tree/HEAD/packages/astro)) | [`6.3.3` → `6.3.5`](https://renovatebot.com/diffs/npm/astro/6.3.3/6.3.5) | ![age](https://developer.mend.io/api/mc/badges/age/npm/astro/6.3.5?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/astro/6.3.3/6.3.5?slim=true) |

---

### Release Notes

<details>
<summary>withastro/astro (astro)</summary>

### [`v6.3.5`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#635)

[Compare Source](https://github.com/withastro/astro/compare/astro@6.3.4...astro@6.3.5)

##### Patch Changes

- [#&#8203;16771](withastro/astro#16771) [`07c8805`](withastro/astro@07c8805) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Fixes `position` prop on `<Image>` and `<Picture>` components breaking Content Security Policy (CSP).

- [#&#8203;16593](withastro/astro#16593) [`50924ce`](withastro/astro@50924ce) Thanks [@&#8203;yanthomasdev](https://github.com/yanthomasdev)! - Improves error messages with more consistent and correct writing.

- [#&#8203;16757](withastro/astro#16757) [`5d661cd`](withastro/astro@5d661cd) Thanks [@&#8203;astrobot-houston](https://github.com/astrobot-houston)! - Fixes dev server serving stale content when SSR-only modules change (e.g. `.astro` files outside the project root in a monorepo, or dynamically imported components).

  Previously, the `astro:hmr-reload` plugin returned an empty array after detecting SSR-only module changes, which prevented Vite's `updateModules` from propagating the invalidation to the SSR module runner. The runner's evaluated module cache stayed stale, so subsequent requests continued returning old content.

  Now the plugin returns the SSR-only modules so Vite can process them through `updateModules`, which properly invalidates the module runner's cache and ensures fresh content on the next request.

### [`v6.3.4`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#634)

[Compare Source](https://github.com/withastro/astro/compare/astro@6.3.3...astro@6.3.4)

##### Patch Changes

- [#&#8203;16723](withastro/astro#16723) [`0f10bfe`](withastro/astro@0f10bfe) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Adds `fetchFile` option to `experimental.advancedRouting` to customize or disable the entrypoint file

  ```js
  export default defineConfig({
    experimental: {
      advancedRouting: {
        fetchFile: 'fetch.ts',
      },
    },
  });
  ```

- [#&#8203;16723](withastro/astro#16723) [`0f10bfe`](withastro/astro@0f10bfe) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes Hono `cache()` middleware to follow the standard wrapper pattern

- [#&#8203;16723](withastro/astro#16723) [`0f10bfe`](withastro/astro@0f10bfe) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Adds `App.Providers` interface for typing custom context providers on `Astro` and `ctx`

  ```ts
  declare namespace App {
    interface Providers {
      oauth: import('./lib/oauth').OAuthSession;
    }
  }
  ```

- [#&#8203;16723](withastro/astro#16723) [`0f10bfe`](withastro/astro@0f10bfe) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Adds `FetchState.response` property, set automatically after `pages()` or `middleware()` completes

  ```ts
  const response = await middleware(state, (s) => pages(s));
  console.log(state.response === response); // true
  ```

- [#&#8203;16723](withastro/astro#16723) [`0f10bfe`](withastro/astro@0f10bfe) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Adds `Fetchable` type export for typing the advanced routing entrypoint

  ```ts
  import type { Fetchable } from 'astro';

  export default {
    async fetch(request) {
      return new Response('ok');
    },
  } satisfies Fetchable;
  ```

- [#&#8203;16572](withastro/astro#16572) [`4a5a077`](withastro/astro@4a5a077) Thanks [@&#8203;DORI2001](https://github.com/DORI2001)! - Suppresses `[WARN] Vite warning: unused imports from "@&#8203;astrojs/internal-helpers/remote"` during prerender builds. The package is now bundled alongside `astro` in the prerender environment, matching how it is handled in the SSR environment.

- [#&#8203;16756](withastro/astro#16756) [`b6ee23d`](withastro/astro@b6ee23d) Thanks [@&#8203;astrobot-houston](https://github.com/astrobot-houston)! - Fixes styles from Markdoc/MDX custom components not being extracted to `<head>` in the dev server when using the Cloudflare adapter with `prerenderEnvironment: 'node'` and rendering content through a wrapper component.

- [#&#8203;16747](withastro/astro#16747) [`904d19a`](withastro/astro@904d19a) Thanks [@&#8203;astrobot-houston](https://github.com/astrobot-houston)! - Fixes Astro action requests failing in `astro dev` when using the Cloudflare adapter with `prerenderEnvironment: 'node'` alongside a prerendered catch-all route such as `[...page].astro`.

  Actions and other SSR POST endpoints now continue to work in dev instead of returning an HTTP 500 error.

- [#&#8203;16701](withastro/astro#16701) [`3495ce4`](withastro/astro@3495ce4) Thanks [@&#8203;demaisj](https://github.com/demaisj)! - Fix `Map` and `Set` instances saved in a content collection being broken when retrieving entries.

- [#&#8203;16614](withastro/astro#16614) [`fca1c32`](withastro/astro@fca1c32) Thanks [@&#8203;Eptagone](https://github.com/Eptagone)! - Fixes `entry.data` type inference when a live collection is configured without a schema.

- [#&#8203;16661](withastro/astro#16661) [`03b8f7f`](withastro/astro@03b8f7f) Thanks [@&#8203;ocavue](https://github.com/ocavue)! - Updates `typescript` to v6. No changes are needed from users.

- [#&#8203;16681](withastro/astro#16681) [`c22770a`](withastro/astro@c22770a) Thanks [@&#8203;dotnetCarpenter](https://github.com/dotnetCarpenter)! - Fixes an issue where SVG images with `width="0"` or `height="0"` incorrectly threw a `NoImageMetadata` error instead of being treated as valid dimensions.

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xODIuMSIsInVwZGF0ZWRJblZlciI6IjQzLjE4Mi4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs pr pkg: astro Related to the core `astro` package (scope)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants