Skip to content
This repository was archived by the owner on Apr 28, 2025. It is now read-only.
This repository was archived by the owner on Apr 28, 2025. It is now read-only.

Wrong http status code (500) returned instead of 404 or any response thrown from a loader. #145

@zvin

Description

@zvin

Have you experienced this bug with the latest version of the template?

yes

Steps to Reproduce

  • npx create-remix@latest;
  • select the blues template, follow the suggested steps;
  • go to any page that doesn't exist, http://0.0.0.0:3000/no-such-page for example
  • see that the returned status is 500 instead of 404

The same issue happens if you throw a json response in a loader: throw json("Unauthorized", { status: 403 });, a 500 status code will be returned to the browser.

It seems like this started happening when updating remix from 1.9.0 to 1.10.0.
The issue does not happen when using remix serve instead of express.
I don't know if the issue comes from the template server.ts file or from the combination of @remix-run/react and @remix-run/express

Expected Behavior

A 404 http status code should be returned.
Capture d’écran du 2023-01-17 20-02-01

Actual Behavior

A 500 http status code is returned.
Capture d’écran du 2023-01-17 19-45-26

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions