You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The issue is likely that Express is looking for files in the wrong directory.
Based on the build output, React Router 7 creates two separate directories:
./build/client - Contains the client-side files (JavaScript, CSS, assets)
./build/server - Contains the server-side rendering code
However, Express might be configured to look in Vite's default output directory (./dist) instead of the ./build/client directory that React Router actually uses.
You might need to update your Express server configuration to serve files from the correct location: the ./build/client directory where React Router places its build output.
oh sorry, this is for the dev server, not the built server. i was launching a backend server along with the vite dev server to save my developers the trouble of starting a separate server. as in attaching the vite middlewares to our existing backend server. but maybe i'll launch it in a child process instead
I'm using React Router as a...
framework
Reproduction
https://github.com/xandris/react-router-middleware-mode
in short, I
npx create-react-router@latest my-react-router-app
npm run build
npm start
(works)start.js
thatthe express app just gives 404s for any request
System Info
Used Package Manager
npm
Expected Behavior
the same functionality as
react-router dev
Actual Behavior
404s for any GET
The text was updated successfully, but these errors were encountered: