R
Railway•11mo ago
Luis Reyes

Error: Docker build failed with npm

I am getting this error: ERROR: failed to solve: process "/bin/bash -ol pipefail -c npm run build" did not complete successfully: exit code: 1. I did npm run build locally and worked just fine
Solution:
@Luis Reyes please read the above conversation between me and fragly, and then read the below text. https://github.com/brody192/create-react-app-starter/tree/main copy the nixpacks.toml and Caddyfile from this repo into yours. this will tell nixpacks to download and run your app with caddy, both increasing site perform and significantly reducing resource usage....
Jump to solution
29 Replies
Percy
Percy•11mo ago
Project ID: N/A
Fragly
Fragly•11mo ago
Mind downloading and sharing your build logs using this? https://bookmarklets.up.railway.app/log-downloader/
Luis Reyes
Luis ReyesOP•11mo ago
on it ok, I made the bookmarklet using the code you provided but where is the data I should provide to you? also I activated the bookmarklet btw
Fragly
Fragly•11mo ago
Once you added the bookmarklet, you can go to your build logs and click on it it'll then download a txt file containing all your logs which you can send in here
Luis Reyes
Luis ReyesOP•11mo ago
that's not working, is there any other option?
Luis Reyes
Luis ReyesOP•11mo ago
Railway
404 - Page not found
Railway is an infrastructure platform where you can provision infrastructure, develop with that infrastructure locally, and then deploy to the cloud.
Fragly
Fragly•11mo ago
Not really, what browser are you using? I know from experience that it's a bit weird on opera, and know it definitally works on chrome
Luis Reyes
Luis ReyesOP•11mo ago
Firefox, OS: Ubuntu 23.10 I'm going to try with Chrome just to make sure I am doing it correctly. I must paste the javascript code on the bookmark's name field, right? because it is not working either on Chrome
Luis Reyes
Luis ReyesOP•11mo ago
ok, doing that now
Fragly
Fragly•11mo ago
seems like a bunch of linting issues
Luis Reyes
Luis ReyesOP•11mo ago
just warnings, not big deal, as I mentioned I built it locally
Fragly
Fragly•11mo ago
Your linting issues is what's causing the build to fail You can either fix them or bypass them by setting a service variable CI to false
Luis Reyes
Luis ReyesOP•11mo ago
I'm going to set a service variable, let me check It worked like a charm thank you
Fragly
Fragly•11mo ago
no problem!
Brody
Brody•11mo ago
you helped them run a development server -_-
Fragly
Fragly•11mo ago
I don't know what a development server is 😭
Brody
Brody•11mo ago
you know when you are working on a frontend site and it will hot reload your changes as you're coding? that's a development server, and that's what they are now running
Fragly
Fragly•11mo ago
Oooh, how do I see when someone runs something like that
Brody
Brody•11mo ago
they use considerably more memory and cpu resources, and as significantly less performant both vite and react-scripts (among other frontend tooling) do not have production servers built into them, if they aren't explicitly using a production web server (caddy, nginx, Apache) they are by default using a development server
Fragly
Fragly•11mo ago
Oh okay, thanks brody 🫡
Brody
Brody•11mo ago
so now what do we do
Fragly
Fragly•11mo ago
We tell him to not use a development server and use something like caddy instead for their web server?
Brody
Brody•11mo ago
true, but we can do one step better, we already have a template for create-react-app that uses caddy
Fragly
Fragly•11mo ago
oh okay, direct them to the template then? 🤔
Brody
Brody•11mo ago
even more specifically though
Solution
Brody
Brody•11mo ago
@Luis Reyes please read the above conversation between me and fragly, and then read the below text. https://github.com/brody192/create-react-app-starter/tree/main copy the nixpacks.toml and Caddyfile from this repo into yours. this will tell nixpacks to download and run your app with caddy, both increasing site perform and significantly reducing resource usage.
Fragly
Fragly•11mo ago
Thanks for teaching me brody :)
Want results from more Discord servers?
Add your server