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
Percy
Percy2y ago
Project ID: d310f282-af2d-4403-87ad-1b51a7b0a761
angelo
angelo2y ago
Hey @pillarofcats - really appreciate you giving us all this information. Lets see what we can do here.
pillarofcats
pillarofcats2y ago
Any help or direction would be greatly appreciated. Thank you.
angelo
angelo2y ago
Absolutely Looking into your project Very strange, can you do a railway up from the /frontend directory?
pillarofcats
pillarofcats2y ago
Yea, I can try, sec.
angelo
angelo2y ago
I am trying to see why we aren't reading your package.json
pillarofcats
pillarofcats2y ago
I am installing and linking railway, okay.
angelo
angelo2y ago
Gotcha I will trigger a redep now
Percy
Percy2y ago
Flagging this thread. A team member will be with you shortly.
pillarofcats
pillarofcats2y ago
Sorry, and thank you. My node isn't recognizing railway after installing for some reason.. attempting to fix real quick.
angelo
angelo2y ago
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 guess
pillarofcats
pillarofcats2y ago
Yea, I will give it a go.
angelo
angelo2y ago
@pillarofcats - can you slam thorugh a new commit on your repo? Seems the CLI deploy worked
angelo
angelo2y ago
Yea, so it appears that you were trying to force through an old config On the old structure
pillarofcats
pillarofcats2y ago
I updated the repo in railway
angelo
angelo2y ago
We should find a way to make it more obv.
pillarofcats
pillarofcats2y ago
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.js
node: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.
Want results from more Discord servers?
Add your server