#Deploying create react app

19 messages · Page 1 of 1 (latest)

smoky jolt
#

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.

blazing zodiacBOT
#

Project ID: 4f0fc161-46d1-43d8-8755-ed4c3ba94e92

old ibex
smoky jolt
#

Dockerfile:24


22 | # build phase

23 | COPY . /app/.

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

#

Its a static app

old ibex
#

Mind downloading the logs using the link I gave you?

smoky jolt
#

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

#

I'll copy the entire logfile, one sec

old ibex
#

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

smoky jolt
#

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

old ibex
#

No problem 🙂

smoky jolt
#

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

old ibex
#

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

fair depot
#

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

old ibex
fair depot
#

#TheMoreYouKnow

smoky jolt
#

Thank you for sharing, I will check it out!

cold geyser
#

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