Build Failed

Service ID: 6ed5a183-bf99-43d3-9634-f9efa9b62756 Trying to deploy my frontend application from GitHub to railway, but I keep getting build fail. The application runs and builds fine on my local machine. Please what could be wrong
13 Replies
Percy
Percy6mo ago
Project ID: 6ed5a183-bf99-43d3-9634-f9efa9b62756
Fragly
Fragly6mo ago
Use this to download your build logs https://bookmarklets.up.railway.app/log-downloader/ that way we can see if there's any errors
Daffydbest
Daffydbest6mo ago
Here's the build log. I simply copied it. My PC is currently having issues hence I cannot use the bookmarklet.
[stage-0 8/10] RUN --mount=type=cache,id=s/6ed5a183-bf99-43d3-9634-f9efa9b62756-node_modules/cache,target=/app/node_modules/.cache npm run build:
95.11 Line 16:11: 'profileError' is assigned a value but never used no-unused-vars 95.11 95.11 src/pages/admin/screens/posts/EditPostV2.jsx 95.11 Line 22:12: 'image' is assigned a value but never used no-unused-vars 95.11 Line 46:16: 'isLoadingDeleteImage' is assigned a value but never used no-unused-vars 95.11 95.11 src/pages/admin/screens/posts/ManagePosts.jsx 95.11 Line 45:48: 'isLoadingDeletePost' is assigned a value but never used no-unused-vars 95.11 95.11 ----- Dockerfile:24 ------------------- 22 | # build phase 23 | COPY . /app/. 24 | >>> RUN --mount=type=cache,id=s/6ed5a183-bf99-43d3-9634-f9efa9b62756-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 Error: Docker build failed #12 95.11 #12 95.11 src/pages/admin/screens/posts/ManagePosts.jsx #12 95.11 Line 45:48: 'isLoadingDeletePost' is assigned a value but never used no-unused-vars #12 95.11 #12 95.11 #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/6ed5a183-bf99-43d3-9634-f9efa9b62756-node_modules/cache,target=/app/node_modules/.cache npm run build:
95.11 Line 16:11: 'profileError' is assigned a value but never used no-unused-vars 95.11 95.11 src/pages/admin/screens/posts/EditPostV2.jsx 95.11 Line 22:12: 'image' is assigned a value but never used no-unused-vars 95.11 Line 46:16: 'isLoadingDeleteImage' is assigned a value but never used no-unused-vars 95.11 95.11 src/pages/admin/screens/posts/ManagePosts.jsx 95.11 Line 45:48: 'isLoadingDeletePost' is assigned a value but never used no-unused-vars 95.11 95.11 ----- Dockerfile:24 ------------------- 22 | # build phase 23 | COPY . /app/. 24 | >>> RUN --mount=type=cache,id=s/6ed5a183-bf99-43d3-9634-f9efa9b62756-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 Error: Docker build failed
Brody
Brody6mo ago
is this a create react app?
Daffydbest
Daffydbest6mo ago
Yes create react app. I've deploy a simple frontend using create react app, 2 days ago and it built successfully
Brody
Brody6mo ago
send the build table at the top of your build logs please
Daffydbest
Daffydbest6mo ago
╔════════ Nixpacks v1.19.0 ═══════╗ ║ setup │ nodejs_18, npm-9_x ║ ║─────────────────────────────────║ ║ install │ npm ci ║ ║─────────────────────────────────║ ║ build │ npm run build ║ ║─────────────────────────────────║ ║ start │ npm run start ║ ╚═══════════════════════════════ This ????
Brody
Brody6mo ago
okay we need to do approximately two things to get your app running... first thing https://github.com/brody192/create-react-app-starter copy the nixpacks.toml and Caddyfile from this repo into your repo second thing, after the above step is done set a service variable CI to false
Daffydbest
Daffydbest6mo ago
Please Can you explain the second step further. I don't understand what you meant by set service variable CI = false. Where will this service state be set? Is it an environment variable within the app on railway?
Brody
Brody6mo ago
click the tab named variables
Daffydbest
Daffydbest6mo ago
Deployment crashed after copying the two files and setting CI to false. using provided configuration Error: adapting config using caddyfile: Unexpected '{' on a new line; did you mean to place the '{' on the previous line?, at Caddyfile:15 using provided configuration Error: adapting config using caddyfile: Unexpected '{' on a new line; did you mean to place the '{' on the previous line?, at Caddyfile:15 using provided configuration Error: adapting config using caddyfile: Unexpected '{' on a new line; did you mean to place the '{' on the previous line?, at Caddyfile:15 using provided configuration Error: adapting config using caddyfile: Unexpected '{' on a new line; did you mean to place the '{' on the previous line?, at Caddyfile:15 using provided configuration Error: adapting config using caddyfile: Unexpected '{' on a new line; did you mean to place the '{' on the previous line?, at Caddyfile:15 using provided configuration Error: adapting config using caddyfile: Unexpected '{' on a new line; did you mean to place the '{' on the previous line?, at Caddyfile:15 using provided configuration Error: adapting config using caddyfile: Unexpected '{' on a new line; did you mean to place the '{' on the previous line?, at Caddyfile:15 using provided configuration Error: adapting config using caddyfile: Unexpected '{' on a new line; did you mean to place the '{' on the previous line?, at Caddyfile:15 using provided configuration Error: adapting config using caddyfile: Unexpected '{' on a new line; did you mean to place the '{' on the previous line?, at Caddyfile:15 using provided configuration Error: adapting config using caddyfile: Unexpected '{' on a new line; did you mean to place the '{' on the previous line?, at Caddyfile:15 using provided configuration Error: adapting config using caddyfile: Unexpected '{' on a new line; did you mean to place the '{' on the previous line?, at Caddyfile:15
Brody
Brody6mo ago
okay im test deploying the repo i linked you and will get back to you it deploys just fine, please dont modify either of those files while copying them to your repo
Daffydbest
Daffydbest6mo ago
Thanks Brody. There was a mistake at line 15. I copied it wrongly I guess. I just recopied and pasted again and it works.