# HP9005: The server answered with an error status

> HP9005 (http-error) means the page's document response had an HTTP error status such as 404 or 500. Fix the route, or list the status the route should return.

Source: https://hydration.jscrate.dev/docs/issues/hp9005
Last updated: 2026-09-18

HP9005 (`http-error`) means the document response for the route had an HTTP
error status, 400 or above, such as a 404 or a 500. The page may still hydrate,
but it is probably not the page you meant to test. Make the route return a
success status, or list the status in the route's expected statuses.

| | |
| --- | --- |
| Code | `HP9005` |
| Name | `http-error` |
| Default severity | Error |
| Group | Test run problems |
| What it means | The document response had an HTTP error status. |

## What the HP9005 http error finding means

hydration-proof checks the status of the document the browser received:

```text
The server answered 500 for http://localhost:3000/products/42.
```

It is an error unless the status is listed in the route's `expectStatus`. The
page is still tested, so a custom 404 page that hydrates with a mismatch is
reported as well.

## Likely causes

- A dynamic route tested with an example value that does not exist, for
  example a product id from `routes.dynamic` that is not in the test database.
- A server error on this route: check the server logs.
- A signed-in page that answers 401 or 403 to a guest scenario.
- An error page on purpose, such as a route for your 404 page.

## How to fix it

Make the route return a success status, or list the status in the route's
expected statuses.

1. For a server error, fix the route; the server logs have the stack trace.
2. For missing data, use example values that exist, or seed them in
   `hooks.setup`.
3. For signed-in pages, test them in a scenario that signs in (see
   [scenarios](https://hydration.jscrate.dev/docs/scenarios)).
4. For a page that should answer with an error, set `expectStatus`:

```ts title="hydration-proof.config.ts"
import { defineConfig } from "hydration-proof";

export default defineConfig({
  routes: {
    paths: ["/", "/pricing", { path: "/404-page", expectStatus: [404] }],
  },
});
```

For Next.js, `routes.notFound` already loads a URL that does not exist and
expects a 404, to check that the not-found page hydrates. [Routes](https://hydration.jscrate.dev/docs/routes)
lists every route option.

## Related

- [HP9004: the page could not be loaded](https://hydration.jscrate.dev/docs/issues/hp9004)
- [HP9010: the route redirected somewhere else](https://hydration.jscrate.dev/docs/issues/hp9010)
- [Route options such as expectStatus](https://hydration.jscrate.dev/docs/routes)
- [Signed-in scenarios](https://hydration.jscrate.dev/docs/scenarios)
