Skip to content

RR7 Build Not Cross-Platform Between Windows and Linux #12805

Open
@NareshBisht

Description

@NareshBisht

I'm using React Router as a...

framework

Reproduction

If I build my RR7 app on Windows and move the build files to an AWS EC2 instance (Amazon Linux 2023 - CentOS), my static files do not load. All static files result in a 404 Not Found error. However, if I move the source code to the EC2 instance and build it there, everything works correctly, and the static files load properly.

STEPS TO REPRODUCDE:

  1. Build the project in Windows using command "npm run build"
  2. Move the build folder to CentOS
  3. Start the prod server using in CentOS using command "react-router serve /build/index.js"
  4. The Static file will not load and result in 404 error.

It seems the issue is due to differences in the 'location' code of server/index.js between Windows and EC2 (refer to the attached image).

Image

System Info

Window 11,
React v19,
react-router: "7.1.1",
vite: "5.4.11",

Used Package Manager

npm

Expected Behavior

If i build my website on Windows and move the source code to Linux(CentOS) based system and start the server the static files should load correctly.

Actual Behavior

When i build my website on Windows and move the source code to Linux(CentOS) based system and start the server the static files do not load. All static files results in "404 not found" error.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions