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
Project ID:
a686cf21-bbfd-4ddb-9e0c-5c11cd434e88
share your repo please?
a686cf21-bbfd-4ddb-9e0c-5c11cd434e88
^
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.
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
Thanks for helping! I think my app has a similar structure. The app is just located in a subdirectory in the repo
also, remove
@railway/cli
from the dependenciesShould I create a new repo with only the react app?
no no
you just need to use serve like my template does
remove the key and regen it please
![](https://utfs.io/f/ddb2a7bd-e3be-499c-ad46-32409c7ffb58-1nq2cb.png)
Yea I kept the repo private before...
its still bad even on private repos
I see. lesson learned. thanks
please make the changes to your react app i suggested
Is this what you are refering to?
![](https://utfs.io/f/c94c0dbc-a09b-422b-b5aa-60893ee052b0-1nq2cb.png)
yes
I made the changes
now it looks like this.
also removed dependency on @railway/cli and all those api keys...
![](https://utfs.io/f/7556f80f-3542-41bd-a35b-b00642f3e319-1nq2cb.png)
you have not installed serve
and your lock file is out of sync
running
npm i serve
will fix both those thingsjust did that
I see the lock file is updated
okay, show me your service variables please
oh I don't have any...
perfect
clear both your build and start commands
sorry... total noob here
not know how to clear those things?
in build settings?
in the service settings
![](https://utfs.io/f/3596d758-ae1d-405f-bc6d-55e2d95470c8-1nq2cb.png)
This is my build command cd react_app && npm install && npm run build for build commandwhere did you have this set?
in build command in the screenshot above
perfect
next step
set
Root Directory
to /web_chat
in the service settingsdone
and tell me if anything goes wrong
ok. building now.
how come the build log says No build logs found for deployment
screenshot please
![](https://utfs.io/f/e968fb35-0fd6-4a24-a95b-db7b9cc38fb7-1nq2cb.png)
well thats not supposed to happen lol
you are welcome to cancel it and try again
hmmm I also tried railway up from terminal
I was able to see logs there
you don't need to use railway up, you are deploying from github
build succeed and it says active! but I still see no logs
unlucky
can you access the site with the domain?
![](https://utfs.io/f/ef509d74-62ac-423e-8e1f-c7c7d44c6707-1nq2cb.png)
go to the service settings and generate one
I thought railway would give me an URL to access the site
yea
I can
Just generated a URL
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
I see
Normally there should be logs right?
yes normally, but railway is in the progress of migrating their logging infrastructure so you might have got caught up in that
I see. Thank you so much!
so website works?
yes.
But seems like the flask server is not running.
Is there anything I need to do for the concurrently?
![](https://utfs.io/f/5cbfdbec-b203-4f72-9aed-828fd67547a5-1nq2cb.png)
yes that would need to be ran in a separate service
I see...
move it to its own root folder
then create a new service deplying from the same github repo, and just the root dir accordingly
Will do. Thank you so much!
no problem!
heres an example flask app
https://github.com/railwayapp-templates/flask
👍