Opening a Room link directly returns 500 in production #311

Closed
opened 2026-10-09 11:18:02 +00:00 by root · 1 comment
root commented 2026-10-09 11:18:02 +00:00 (Migrated from gitlab.core-project.space)

Imported from GitHub amaurycoudr/chess-project#311, opened by @amaurycoudr on 2026-10-09 11:18 UTC.
Closed on GitHub on 2026-10-09 11:28 UTC as completed.


What happens

On the deployed site, GET / serves the front, but every client route opened directly returns 500:

GET https://chess-project-84ph.onrender.com/room/ABC123  -> 500 {"statusCode":500,"message":"Internal server error"}
GET https://chess-project-84ph.onrender.com/local        -> 500

So a Player who opens a shared Room link can't join, and a reload inside a Room fails too.

Expected

Any client route the API doesn't handle (not /rpc) answers 200 with the front's index.html, as apps/api/test/front.integration.test.ts asserts in-process.

What is known

  • Reproduced locally the way Render runs it: FRONT_DIST_DIR=apps/front/dist node apps/api/dist/main.js. The relative path makes the static fallback throw TypeError: path must be absolute or specify root to res.sendFile (@nestjs/serve-static 12 on Express 5).
  • With an absolute FRONT_DIST_DIR, the same routes give 404 instead of index.html.
  • CI missed it: the browser suite's built target serves the front with vite preview, never through the API the way production does.

Found while running the browser suite against production for #305 (spec #303).

> _Imported from GitHub [amaurycoudr/chess-project#311](https://github.com/amaurycoudr/chess-project/issues/311), opened by [@amaurycoudr](https://github.com/amaurycoudr) on 2026-10-09 11:18 UTC._ > _Closed on GitHub on 2026-10-09 11:28 UTC as completed._ <!-- github-issue:311 --> --- ## What happens On the deployed site, `GET /` serves the front, but every client route opened directly returns 500: ``` GET https://chess-project-84ph.onrender.com/room/ABC123 -> 500 {"statusCode":500,"message":"Internal server error"} GET https://chess-project-84ph.onrender.com/local -> 500 ``` So a **Player** who opens a shared **Room** link can't join, and a reload inside a **Room** fails too. ## Expected Any client route the API doesn't handle (not `/rpc`) answers 200 with the front's `index.html`, as `apps/api/test/front.integration.test.ts` asserts in-process. ## What is known - Reproduced locally the way Render runs it: `FRONT_DIST_DIR=apps/front/dist node apps/api/dist/main.js`. The relative path makes the static fallback throw `TypeError: path must be absolute or specify root to res.sendFile` (@nestjs/serve-static 12 on Express 5). - With an absolute `FRONT_DIST_DIR`, the same routes give 404 instead of `index.html`. - CI missed it: the browser suite's `built` target serves the front with `vite preview`, never through the API the way production does. Found while running the browser suite against production for #305 (spec #303).
root (Migrated from gitlab.core-project.space) closed this issue 2026-10-09 11:28:35 +00:00
root commented 2026-10-13 10:22:15 +00:00 (Migrated from gitlab.core-project.space)

mentioned in commit 18aaa076aa

mentioned in commit 18aaa076aa313f0de4ba3350403e5ee1f449eef9
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
amaurycoudr/chess-project#311
No description provided.