Skip to content

fix: improve error message with debugging context#16927

Closed
omsrisrieternalradhakrsna wants to merge 1 commit into
withastro:mainfrom
omsrisrieternalradhakrsna:fix/improve-error-message
Closed

fix: improve error message with debugging context#16927
omsrisrieternalradhakrsna wants to merge 1 commit into
withastro:mainfrom
omsrisrieternalradhakrsna:fix/improve-error-message

Conversation

@omsrisrieternalradhakrsna
Copy link
Copy Markdown

What

Improves an error message in callGetStaticPaths() to include more debugging context.

The previous message was a bare Unexpected Error. with no indication of which route or component triggered it. The new message includes:

  • The route pattern (route.route)
  • The source component path (route.component)
  • A hint about what is expected (exporting getStaticPaths())

Why

Better error messages help developers fix issues faster. When a dynamic route module fails to export getStaticPaths, the developer now sees exactly which component file to inspect instead of a generic error with no context.

NO EM DASHES.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 31, 2026

⚠️ No Changeset found

Latest commit: a630fd8

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@github-actions github-actions Bot added the pkg: astro Related to the core `astro` package (scope) label May 31, 2026
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 31, 2026

Merging this PR will not alter performance

✅ 18 untouched benchmarks


Comparing omsrisrieternalradhakrsna:fix/improve-error-message (a630fd8) with main (86e1190)1

Open in CodSpeed

Footnotes

  1. No successful run was found on main (fa7a264) during the generation of this report, so 86e1190 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@ematipico
Copy link
Copy Markdown
Member

The comment already explains that it's already checked somewhere, so that's a placeholder error.

@ematipico ematipico closed this Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants