Monorepo Vite + React client build and deploy fail

andrei-su
TRIAL

a year ago

I am trying to deploy an isolated monorepo project. I have followed all the steps in the Reailway docs tutorial for Deploying a Monorepo to Railway found at this link https://docs.railway.app/tutorials/deploying-a-monorepo.

The deployment of the node, express, socket.io server works fine.

However I am not able to deploy the client Vite, React code (JS + SWC). I don't seem to get the configuration right or I am missing something.

The error that I am getting when building is " ERROR: failed to solve: process "/bin/bash -ol pipefail -c npm run build" did not complete successfully: exit code: 127 ".

A snapshot of the logs can be found at this link

https://railway.app/project/8ae5ef5a-f797-493f-98aa-f3c03e031e20/logs?filter=%40snapshot%3Aa31f6d1b-c94a-4727-a3c1-cfbdeaa06ca4+OR+%40replica%3Aa31f6d1b-c94a-4727-a3c1-cfbdeaa06ca4&start=1722766325300

I have tried adding Caddy (specifically Caddyfile, nixpacks.toml files and in package.json copied the build script and added the "engines" attribute from the Vite + React and Caddy template found at this link

https://railway.app/template/NeiLty

My GitHub repo for this project is the following

https://github.com/andrei-su/technical-assignment

Any pointers are much appreciated.

1 Replies

a year ago

From your build logs -

sh: 1: tsc: not found