Bulid command failed to cd into target directory

I have a React app located within a GitHub repo, like this Github repo |-----------react_app |-----------"other stuff" This is my build command cd react_app && npm install && npm run build for build command However, build failed with error #13 0.404 /bin/bash: line 1: cd: web_chat: No such file or directory On build settings, I have / as root directory I am new to Railway, would greatly appreciate any help
58 Replies
Percy
Percy2y ago
Project ID: a686cf21-bbfd-4ddb-9e0c-5c11cd434e88
Brody
Brody2y ago
share your repo please?
aj3163
aj3163OP2y ago
a686cf21-bbfd-4ddb-9e0c-5c11cd434e88
Brody
Brody2y ago
^
aj3163
aj3163OP2y ago
https://github.com/arthurjis/nplace_llm and web_chat is the react app
GitHub
GitHub - arthurjis/nplace_llm
Contribute to arthurjis/nplace_llm development by creating an account on GitHub.
Brody
Brody2y ago
for your react app, please update it according to this template https://github.com/brody192/create-react-app-starter once done, let me know and i will tell you the next step
aj3163
aj3163OP2y ago
Thanks for helping! I think my app has a similar structure. The app is just located in a subdirectory in the repo
Brody
Brody2y ago
also, remove @railway/cli from the dependencies
aj3163
aj3163OP2y ago
Should I create a new repo with only the react app?
Brody
Brody2y ago
no no you just need to use serve like my template does remove the key and regen it please
Brody
Brody2y ago
aj3163
aj3163OP2y ago
Yea I kept the repo private before...
Brody
Brody2y ago
its still bad even on private repos
aj3163
aj3163OP2y ago
I see. lesson learned. thanks
Brody
Brody2y ago
please make the changes to your react app i suggested
aj3163
aj3163OP2y ago
Is this what you are refering to?
Brody
Brody2y ago
yes
aj3163
aj3163OP2y ago
I made the changes
aj3163
aj3163OP2y ago
now it looks like this. also removed dependency on @railway/cli and all those api keys...
Brody
Brody2y ago
you have not installed serve and your lock file is out of sync running npm i serve will fix both those things
aj3163
aj3163OP2y ago
just did that I see the lock file is updated
Brody
Brody2y ago
okay, show me your service variables please
aj3163
aj3163OP2y ago
oh I don't have any...
Brody
Brody2y ago
perfect clear both your build and start commands
aj3163
aj3163OP2y ago
sorry... total noob here
Brody
Brody2y ago
not know how to clear those things?
aj3163
aj3163OP2y ago
in build settings?
Brody
Brody2y ago
in the service settings
aj3163
aj3163OP2y ago
Brody
Brody2y ago
This is my build command cd react_app && npm install && npm run build for build command
where did you have this set?
aj3163
aj3163OP2y ago
in build command in the screenshot above
Brody
Brody2y ago
perfect next step set Root Directory to /web_chat in the service settings
aj3163
aj3163OP2y ago
done
Brody
Brody2y ago
and tell me if anything goes wrong
aj3163
aj3163OP2y ago
ok. building now. how come the build log says No build logs found for deployment
Brody
Brody2y ago
screenshot please
aj3163
aj3163OP2y ago
Brody
Brody2y ago
well thats not supposed to happen lol you are welcome to cancel it and try again
aj3163
aj3163OP2y ago
hmmm I also tried railway up from terminal I was able to see logs there
Brody
Brody2y ago
you don't need to use railway up, you are deploying from github
aj3163
aj3163OP2y ago
build succeed and it says active! but I still see no logs
Brody
Brody2y ago
unlucky can you access the site with the domain?
aj3163
aj3163OP2y ago
Brody
Brody2y ago
go to the service settings and generate one
aj3163
aj3163OP2y ago
I thought railway would give me an URL to access the site yea I can Just generated a URL
Brody
Brody2y ago
you have to tell railway you want want first, since you could be running a discord bot for example, that doesn't need a domain so it would be wasteful to generate one if it might not be needed
aj3163
aj3163OP2y ago
I see Normally there should be logs right?
Brody
Brody2y ago
yes normally, but railway is in the progress of migrating their logging infrastructure so you might have got caught up in that
aj3163
aj3163OP2y ago
I see. Thank you so much!
Brody
Brody2y ago
so website works?
aj3163
aj3163OP2y ago
yes. But seems like the flask server is not running.
aj3163
aj3163OP2y ago
Is there anything I need to do for the concurrently?
Brody
Brody2y ago
yes that would need to be ran in a separate service
aj3163
aj3163OP2y ago
I see...
Brody
Brody2y ago
move it to its own root folder then create a new service deplying from the same github repo, and just the root dir accordingly
aj3163
aj3163OP2y ago
Will do. Thank you so much!
Brody
Brody2y ago
no problem! heres an example flask app https://github.com/railwayapp-templates/flask
aj3163
aj3163OP2y ago
👍
Want results from more Discord servers?
Add your server