Skip to content

Expertimental rewrite: when target page throws an error, this results in "404 Not Found" #11110

@arty-name

Description

@arty-name

Astro Info

Astro                    v4.8.4
Node                     v20.13.1
System                   Linux (x64)
Package Manager          unknown
Output                   server
Adapter                  @astrojs/node
Integrations             @sentry/astro

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

I tried using rewrites for an existing page and they work fine! However sometimes this existing page throws an error, and this case is not handled well.

Without rewrite, Astro developer tools show a nice UI for exceptions thrown in the standalone Node backend.

With rewrite, this doesn’t happen. First of all, any kind of error results in a 404 Not Found message. Second, this is not handled by Astro developer tools, so after followup changes I need to manually reload the page to see results.

What's the expected result?

Astro developer tools should handle the exception. The original exception should be shown, not "Not Found".

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-h5n839?file=src%2Fpages%2Findex.astro

Participation

  • I am willing to submit a pull request for this issue.

Metadata

Metadata

Assignees

Labels

- P3: minor bugAn edge case that only affects very specific usage (priority)feat: routingRelated to Astro routing (scope)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions