React Application Builds But Observe 404

jw-kriewallTRIAL

a year ago

My react frontend is building but I am seeing a 404 when accessing the url. I followed the instructions here as my application was built off create-react-app: https://help.railway.app/project-help/f9v3gkPQRy4UShk5SnoPDH/getting-your-create-react-app-running-on-railway/qHRsgxa5n57xLp1yVgk9fP

I am not sure where to go from here as the deployment shows successful but the webpage returns 404. I am wondering if it has anything to do with the build command that was suggested to be omitted per the article above.

3 Replies

a year ago

the guide says to remove any build or start commands in the service settings, as a default create-react-app has its build script set in the package.json instead.

if you do not have a build script in your package.json please add it back.


jw-kriewallTRIAL

a year ago

Hi Brody - Thanks for your help! Your suggestion resulted in the logs below. I added the build command back, but now the build is failing entirely from Step #12.

Here's the entirety of my scripts from the package.json:
"scripts": {
"start": "serve build -s -n -L -p $PORT",
"dev": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},

LOGS:

12 ERROR: process "/bin/bash -ol pipefail -c npm run build" did not complete successfully: exit code: 1

[stage-0 8/10] RUN --mount=type=cache,id=s/12d5b8cf-b29d-49e0-97d4-4b49e6c3e099-nodemodules/cache,target=/app/nodemodules/.cache npm run build:

29.48

29.48

29.48

29.48

Dockerfile:24

22 | # build phase

23 | COPY . /app/.

24 | >>> RUN --mount=type=cache,id=s/12d5b8cf-b29d-49e0-97d4-4b49e6c3e099-nodemodules/cache,target=/app/nodemodules/.cache npm run build

25 |

26 |

ERROR: failed to solve: process "/bin/bash -ol pipefail -c npm run build" did not complete successfully: exit code: 1
Error: Docker build failed


a year ago

please provide your full build logs using this tool https://bookmarklets.up.railway.app/log-downloader/


React Application Builds But Observe 404 - Railway Help Station