Unable to build app
PID: d310f282-af2d-4403-87ad-1b51a7b0a761
User: Pillarofcats
Github Repo: https://github.com/Pillarofcats/mern_fullstack_restaurant_reviews
Note:
I use vite now for react applications, but this was done with create-react-app. If a solution can be found refactoring with with vite I can do so.
Execution desc:
build react app production files -> serve production files through nodejs
Execution local cmds:
npm run build && (cd backend && npm start)
Issue:
I have been stuck for a while reading through the nixpacks.toml documentation and the railway docs pertaining to monorepos, start, and build configurations. I am fairly new to the configurations and implementing them.
My project works on my local environment, but fails to deploy with a build log of: Nixpacks was unable to generate a build plan for this app.
Latest configuration attempt:
Root Dir: /frontend
Build Cmd: npm run build (build react production files for nodejs to serve)
Start Cmd: npm run start:backend (start nodejs server from backend folder)
Thank you for your time
RESOLVED
18 Replies
Project ID:
d310f282-af2d-4403-87ad-1b51a7b0a761
Hey @pillarofcats - really appreciate you giving us all this information. Lets see what we can do here.
Any help or direction would be greatly appreciated. Thank you.
Absolutely
Looking into your project
Very strange, can you do a
railway up
from the /frontend directory?Yea, I can try, sec.
I am trying to see why we aren't reading your
package.json
I am installing and linking railway, okay.
Gotcha
I will trigger a redep now
Flagging this thread. A team member will be with you shortly.
Sorry, and thank you. My node isn't recognizing railway after installing for some reason.. attempting to fix real quick.
Very strange, escalated internaly but we can't get to this immediately,.
Can ya make a repo only with the contents of
frontend
?
My guess its a directory issue... just a guessYea, I will give it a go.
@pillarofcats - can you slam thorugh a new commit on your repo?
Seems the CLI deploy worked
I just made a new one: https://github.com/Pillarofcats/RestaurantReviewer
Yea, so it appears that you were trying to force through an old config
On the old structure
I updated the repo in railway
We should find a way to make it more obv.
Yea, I am getting this now: Could not find root directory: /tmp/3562698755
Oh...
So, it is green now, but it seems it isn't loading the server now.
node index.jsnode:internal/modules/cjs/loader:959 throw err; ^ Error: Cannot find module 'mongodb' Require stack: - /app/backend/dataAccessObject/restaurantsDAO.js - /app/backend/api/restaurants.controller.js - /app/backend/api/restaurants.route.js - /app/backend/server.js - /app/backend/index.js I have my environment variables set up in the railway config Ok, I think it is going to work after I make some changes. The .env from railway I am assuming is at the root, but my server cannot read it because it is nested maybe.