R
Railway15mo ago
aj3163

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
Percy15mo ago
Project ID: a686cf21-bbfd-4ddb-9e0c-5c11cd434e88
Brody
Brody15mo ago
share your repo please?
aj3163
aj316315mo ago
a686cf21-bbfd-4ddb-9e0c-5c11cd434e88
Brody
Brody15mo ago
^
aj3163
aj316315mo 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
Brody15mo 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
aj316315mo ago
Thanks for helping! I think my app has a similar structure. The app is just located in a subdirectory in the repo
Brody
Brody15mo ago
also, remove @railway/cli from the dependencies
aj3163
aj316315mo ago
Should I create a new repo with only the react app?
Brody
Brody15mo ago
no no you just need to use serve like my template does remove the key and regen it please
Brody
Brody15mo ago
aj3163
aj316315mo ago
Yea I kept the repo private before...
Brody
Brody15mo ago
its still bad even on private repos
aj3163
aj316315mo ago
I see. lesson learned. thanks
Brody
Brody15mo ago
please make the changes to your react app i suggested
aj3163
aj316315mo ago
Is this what you are refering to?
Brody
Brody15mo ago
yes
aj3163
aj316315mo ago
I made the changes
aj3163
aj316315mo ago
now it looks like this. also removed dependency on @railway/cli and all those api keys...
Brody
Brody15mo ago
you have not installed serve and your lock file is out of sync running npm i serve will fix both those things
aj3163
aj316315mo ago
just did that I see the lock file is updated
Brody
Brody15mo ago
okay, show me your service variables please
aj3163
aj316315mo ago
oh I don't have any...
Brody
Brody15mo ago
perfect clear both your build and start commands
aj3163
aj316315mo ago
sorry... total noob here
Brody
Brody15mo ago
not know how to clear those things?
aj3163
aj316315mo ago
in build settings?
Brody
Brody15mo ago
in the service settings
aj3163
aj316315mo ago
Brody
Brody15mo ago
This is my build command cd react_app && npm install && npm run build for build command
where did you have this set?
aj3163
aj316315mo ago
in build command in the screenshot above
Brody
Brody15mo ago
perfect next step set Root Directory to /web_chat in the service settings
aj3163
aj316315mo ago
done
Brody
Brody15mo ago
and tell me if anything goes wrong
aj3163
aj316315mo ago
ok. building now. how come the build log says No build logs found for deployment
Brody
Brody15mo ago
screenshot please
aj3163
aj316315mo ago
Brody
Brody15mo ago
well thats not supposed to happen lol you are welcome to cancel it and try again
aj3163
aj316315mo ago
hmmm I also tried railway up from terminal I was able to see logs there
Brody
Brody15mo ago
you don't need to use railway up, you are deploying from github
aj3163
aj316315mo ago
build succeed and it says active! but I still see no logs
Brody
Brody15mo ago
unlucky can you access the site with the domain?
aj3163
aj316315mo ago
Brody
Brody15mo ago
go to the service settings and generate one
aj3163
aj316315mo ago
I thought railway would give me an URL to access the site yea I can Just generated a URL
Brody
Brody15mo 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
aj316315mo ago
I see Normally there should be logs right?
Brody
Brody15mo ago
yes normally, but railway is in the progress of migrating their logging infrastructure so you might have got caught up in that
aj3163
aj316315mo ago
I see. Thank you so much!
Brody
Brody15mo ago
so website works?
aj3163
aj316315mo ago
yes. But seems like the flask server is not running.
aj3163
aj316315mo ago
Is there anything I need to do for the concurrently?
Brody
Brody15mo ago
yes that would need to be ran in a separate service
aj3163
aj316315mo ago
I see...
Brody
Brody15mo 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
aj316315mo ago
Will do. Thank you so much!
Brody
Brody15mo ago
no problem! heres an example flask app https://github.com/railwayapp-templates/flask
aj3163
aj316315mo ago
👍
Want results from more Discord servers?
Add your server
More Posts