Deploying create react app
slicksammy
PROOP

2 years ago

Project id 4f0fc161-46d1-43d8-8755-ed4c3ba94e92

I'm trying to deploy a create-react-app project but the build fails. First it failed with "yarn run build" and then I set "npm run build" as the command and that also failed.

These commands work fine locally.

17 Replies

dev
MODERATOR

2 years ago

Mind sharing your build logs?


slicksammy
PROOP

2 years ago

Dockerfile:24

22 | # build phase

23 | COPY . /app/.

24 | >>> RUN --mount=type=cache,id=s/8f9db790-14c3-4a96-81d3-4f4a2ac4805f-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


slicksammy
PROOP

2 years ago

Its a static app


dev
MODERATOR

2 years ago

Mind downloading the logs using the link I gave you?


slicksammy
PROOP

2 years ago

I don't want to use that link bro, sorry. I don't know what it is and how it works


slicksammy
PROOP

2 years ago

I'll copy the entire logfile, one sec


slicksammy
PROOP

2 years ago


dev
MODERATOR

2 years ago

looks to me like eslint errors, you need to fix those to deploy your app
if you don't want to bother fixing the errors then you can set CI to false in your service variables


slicksammy
PROOP

2 years ago

Thanks bud. I did not realize that eslint errors would prevent deploying, first time deploying SPA. Thank you!


dev
MODERATOR

2 years ago

No problem 🙂


slicksammy
PROOP

2 years ago

Just one more quick question - for static SPA, am i supposed to deploy to Railway or use a static site service?


dev
MODERATOR

2 years ago

either could work, although I would personally use Railway ( definitely biased though )


medim
MODERATOR

2 years ago

You can deploy to railway but u will need something to serve that static file


dev
MODERATOR

2 years ago

Nixpacks can actually serve static files, you just throw a Staticfile file in your project


medim
MODERATOR

2 years ago

TheMoreYouKnow


slicksammy
PROOP

2 years ago

Thank you for sharing, I will check it out!


dihmeetree
PRO

2 years ago

If it's simply a static website.. i'd throw a CDN in front of it personally (like Cloudflare for example), but not necessary 🙂


Loading...