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:Jump to 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....
29 Replies
Project ID:
N/A
Mind downloading and sharing your build logs using this?
https://bookmarklets.up.railway.app/log-downloader/
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
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
that's not working, is there any other option?
I guess you can pull out the project ID and service ID from this URL https://railway.app/project/a974c645-2371-4ab0-b4dc-30ad851fa136/service/239a608c-98d2-4791-9b06-6454513e031b?id=4979166c-efe1-4e43-bed3-84cc79ab9dd1
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.
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
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
ok, doing that now
seems like a bunch of linting issues
just warnings, not big deal, as I mentioned I built it locally
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
I'm going to set a service variable, let me check
It worked like a charm
thank you
no problem!
you helped them run a development server -_-
I don't know what a development server is ðŸ˜
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
Oooh, how do I see when someone runs something like that
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
Oh okay, thanks brody 🫡
so now what do we do
We tell him to not use a development server and use something like caddy instead for their web server?
true, but we can do one step better, we already have a template for create-react-app that uses caddy
oh okay, direct them to the template then? 🤔
even more specifically though
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.
Thanks for teaching me brody :)