help with using craco with docker
See original GitHub issueI am trying to get craco to work with my app which is running in a docker image. For some reason after I install craco I am getting an error when running it saying there is a webpack conflict. It’s putting webpack 4.43.0 and react scripts requires 4.42.0.
This is what I am getting when I run npm list webpack
/app # npm list webpack
app@0.1.0 /app
±- craco@0.0.3
| -- webpack@4.43.0
– react-scripts@3.4.1
`-- webpack@4.42.0
does anyone know why this might be happening? Thanks!
Issue Analytics
- State:
- Created 3 years ago
- Comments:18 (6 by maintainers)
Top Results From Across the Web
Craco with SemanticUI in Docker · Issue #96 - GitHub
Is there anybody trying to use Craco + ReactJS + Docker? I'm trying to follow these instructions: https://react.semantic-ui.com/theming.
Read more >React App with craco doesn't start in docker-compose
The answer tells that, docker and webpack are in conflict to what is the internal container address. I changed my config.js file like...
Read more >How to Add Docker to Create React App(CRA) + Run Unit Tests
In this tutorial, we'll be learning how to add a docker to Create-React App ... In Docker, the containers running share the host...
Read more >Dockerize your React app - DEV Community
I like putting react apps in containers! I created a docker compose files that runs create-react-app based apps loacally on Docker! dev.to/ ...
Read more >How to Docker with React - Robin Wieruch
Before we can continue with Docker, we need to change one line in our package.json for starting the Webpack development server. The host...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @gregoryforel, I am not very good at docker either. But I will try my best.
Here is my docker file for the client service:
In my package.json I have
"dev": "nodemon craco start"
Here is the client section in my docker-compose.yml
notice the last line tty: true. This is what made it work. However the terminal logging is acting a bit strange. Debugging is not as easy as before.
Hope this helps.
@yohanb I finally got it to work. I added tty: true to my docker file, then run docker-compose using a -d flag. Although the logging behavior is a bit annoying now so a bit harder to debug. The container wasn’t failing, npm just calls craco and as soon as it hands off to craco it considered it as a success and exit with an exit code of 0. If you guys figure out another way to get this to work, please let me know. Thanks!