errors with react using nixpack.toml/Caddyfile
zach-d
HOBBYOP

2 years ago

trying to deploy a react front end, followed advice I got here a few days ago to use Caddyfile and nixpacks.toml in here https://github.com/zach-dubroc/noted-web-app, but can't get past this error has anyone else run int this?

Dockerfile:50

48 | COPY --from=0 /app/caddy /app/caddy
49 | COPY --from=0 /app/Caddyfile /app/Caddyfile
50 | >>> COPY --from=0 /app/build /app/build
51 | CMD ["./caddy run --config Caddyfile --adapter caddyfile 2>&1"]

52 |

ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref 97a9a95d-b933-4d77-b985-b15d61c0d785::pouf6ddgfxm5jlpjy0w2k5nzm: "/app/build": not found

Error: Docker build failed

View Deploy details

ⓘ Deployment information is only viewable by Project members and Railway admins.

20 Replies

zach-d
HOBBYOP

2 years ago

attached screenshot of more of the build logs

Attachments


2 years ago

React with Vite or create-react-app?


zach-d
HOBBYOP

2 years ago

Vite!


zach-d
HOBBYOP

2 years ago

it's deploying now after the new nixpacks.toml file but this error is happening:

Attachments


2 years ago

https://github.com/brody192/vite-react-template

Please make sure you are using the nixpacks.toml and Caddyfile from this repo.


zach-d
HOBBYOP

2 years ago

yep! using those but still getting the 404 error when I try to run, what service variables should be in the frontend side? they are linked to the postrgres db url in the actual project, am I missing a step on the railway side?


2 years ago

You are using the correct nixpacks.toml file, but the incorrect Caddyfile, please use the Caddyfile from the repo I linked.


zach-d
HOBBYOP

2 years ago

failed with that caddyfile as well with this error:

ERROR: failed to solve: process "/bin/bash -ol pipefail -c curl -fsSLo caddy.tar.gz \"[https://github.com/caddyserver/caddy/releases/download/v${CADDYVERSION}/caddy${CADDYVERSION}linuxamd64.tar.gz](https://github.com/caddyserver/caddy/releases/download/v${CADDYVERSION}/caddy${CADDYVERSION}linuxamd64.tar.gz)"" did not complete successfully: exit code: 56

Error: Docker build failed



zach-d
HOBBYOP

2 years ago

attatched! that is a nifty little tool didn't know about that haha

Attachments


2 years ago

SSL errors from GitHub, that's not ideal.


zach-d
HOBBYOP

2 years ago

so I just redeployed and the build/deploy went through but no connection still? attached deploy logs but not sure what those errors means at all

Attachments


2 years ago

There's no access logs there meaning you where still hitting the old deployment, try again.


zach-d
HOBBYOP

2 years ago

just got done, same issue it looks like, even pushed the repo again it has the current caddy/nixpacks files, what would make it it hit an old deployment?


zach-d
HOBBYOP

2 years ago

WAIT IT WORKED, no idea what made it go through this time but I can see my registration page! I'm riddled with Axios errors now trying to post to db. but that's problems that I'm used to at least lol


2 years ago

Do you mean post to your backend? a client side rendered frontend would not send requests to a database.


zach-d
HOBBYOP

2 years ago

yep yep it tries to send the post request to backend, but keep getting a either a cors or axios error, tried setting my axios baseURL a few different ways cause that seems like the issue, no luck so far though


2 years ago

Your API URL is most certainly not the database URL, it needs to be the URL of your backend.


zach-d
HOBBYOP

2 years ago

OHHHH, so if I don't use the database url variable, is it just the url from the backend network?


2 years ago

You need to use the URL of your backend.


Loading...