-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[React-Scripts] v3.4.1 fails to start in Docker #8688
Comments
After digging into the source code, I believe the issue is that
publicPath passed to webpack to be undefined.
|
Update: using customize-cra i forced the publicPath to be set to |
Ah, 7e6d6cd is the cause. When I set |
For anyone else that stumbles on this, instead of using It is impossible to run in the background now without the |
Same here with |
Adding |
Please see here for details facebook/create-react-app#8688
Adding stdin_open stands for interactive and tty means terminal. If you do a quick google search you find this: 7e6d6cd clearly indicates a check for interactivity. docker run by default allocates tty. So that's why that works. Docker's documentation says: "For interactive processes (like a shell), you must use -i -t together in order to allocate a tty for the container process." |
The dev environment can be started, but the production environment is blank on browser |
* fixes create react app bug: facebook/create-react-app#8688 * adds styling to frontend app * improves frontend dockerfile * adds additional commands to makefile and README
* fixes create react app bug: facebook/create-react-app#8688 * adds styling to frontend app * improves frontend dockerfile * adds additional commands to makefile and README
* fixes create react app bug: facebook/create-react-app#8688 * adds styling to frontend app * improves frontend dockerfile * adds additional commands to makefile and README
* fixes create react app bug: facebook/create-react-app#8688 * adds styling to frontend app * improves frontend dockerfile * adds additional commands to makefile and README
* fixes create react app bug: facebook/create-react-app#8688 * adds styling to frontend app * improves frontend dockerfile * adds additional commands to makefile and README
* fixes create react app bug: facebook/create-react-app#8688 * adds styling to frontend app * improves frontend dockerfile * adds additional commands to makefile and README
* fixes create react app bug: facebook/create-react-app#8688 * adds styling to frontend app * improves frontend dockerfile * adds additional commands to makefile and README
I am a user of CircleCI, I use a cypress orb to run my e2e tests
Rollbacking to 3.4.0 make it works (I was using the 3.3.1 version before and it worked) In my case I do not have much control over the docker being runned |
I see lot of workarounds here. It's very unfortunate that step up from 3.4.0 to 3.4.1 (very minor improvement... yeap) causes that many of developers looses hours for additional reasearch to find out what stopped working - exit code 0... |
It's working for me thanks!! |
upgrading to 3.4.1 with the change made from #7203 is also causing my circle ci puppeteer pipelines to break by closing the process. will start looking for workarounds. |
Issue also affects kubernetes deployments based off of using the npm start command inside a docker image. an exit 0 is returned causing the pod to enter crashloopback. |
I currently have this docker-compose.yml
And the error is still present. |
I belive |
As stated before, either
|
Yes, and that's what I meant, since @nettelandways had |
This has stumped me for hours. Docker is huge - please document this somewhere. - a section here would be lovely - https://create-react-app.dev/docs/getting-started |
I am still getting the same issue as highlighted by "nettelandways" 5 days ago. same works fine if i use docker run -it -p....... command. Server comes up. Please suggest what to change. |
Configuring docker or docker-compose to run interactively is not a solution, it's a workaround and not how I understand docker containers are intended to be run. Introducing this to your Dockerfile or docker-compose.yml will introduce unnecessary changes and may have unforeseen consequences. The issue is in react-scripts and your best bet is to stay on 3.4.0 until 3.4.2 is released where this will hopefully be fixed. A minor tweak, which was accepted in #8845, should resolve this. |
For me, deleting all images and containers (used and |
Hello you should add those lines and it will work fine |
Based on this merged code, It turns out that we have these 3 options:
Just remember that if you choose to downgrade your react-script version, you should verify if there's any dependency conflict because of that and you will lose any bugfix on that minor version bump |
Guys, |
I am using a fork of react-scripts so cannot downgrade. I cherry picked #8845 and the process still exited with a 0. Also removed that entire section that was added in 3.4.1 and still exiting with a 0.
|
* Update dependencies * Update docker dependencies * Fix typescript error * Downgrade cra version causing build to fail Caused by facebook/create-react-app/issues/8688
react-scripts 3.4.1 breaks running inside docker containers. See: facebook/create-react-app#8688
react-scripts 3.4.1 breaks running inside docker containers. See: facebook/create-react-app#8688
Don't know the details why, but see this facebook/create-react-app#8688
Describe the bug
I updated from
[email protected]
to[email protected]
and when I attempted to restart my Docker container using the new version it exited with code 0.This is all the logs had, but running
docker-compose ps
showed an exit code of 0. I tried running with/withoutreact-app-rewired
to rule that out as an issue, but the only thing that solved the issue was downgrading to~3.3.0
again.One weirdness I see that is different from 3.3.0 and 3.4.1 is the
webpack output is served from
line is blank in 3.4.1 but says/
in 3.3.0.Did you try recovering your dependencies?
I ran a fresh Docker rebuild with no cache using
node:erbium
as the base image to ensure there was no corruption. No luck.Which terms did you search for in User Guide?
Docker, exit code 0.
Environment
Ran in my docker container to ensure the output is accurate.
Steps to reproduce
Expected behavior
I expected the server to start.
Actual behavior
The server exited with status code 0 and no output after
Starting the development server...
Reproducible demo
All CRA settings are left as their default. No CLI flags or env vars other than
NODE_ENV=development
.Here's my Dockerfile:
The text was updated successfully, but these errors were encountered: