Skip to content

Catch all no longer working after upgraging to nest v11 #1583

@SteadEXE

Description

@SteadEXE

Did you read the migration guide?

  • I have read the whole migration guide

Is there an existing issue that is already proposing this?

  • I have searched the existing issues

Potential Commit/PR that introduced the regression

No response

Versions

4.0.2 -> 5.0.2

Describe the regression

I serve a react PWA with @nestjs/serve-static, when we use a non existing route (handled by react-router-dom) nest serves index.html.
After upgrading it no longer works, it reply with a 404 not found json response.

I tried to play with different options without any success.

Minimum reproduction code

Git repo:
https://github.com/SteadEXE/serve-static-repro

Go on https://localhost:3000/ and http://localhost:3000/any-thing-that-does-not-exist

It should serve the hello world index.html file in both case when working.

package.json is the nest v11
package.working.json is the package file with nest v10

Expected behavior

ServeStaticModule should serve index.html (like mentioned in the doc) in the case of user requests a route that does not exist.

Other

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions