question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

React Hot Reload not working on Docker For Windows

See original GitHub issue

I’ve been looking into getting hot reload to work on docker for windows. I’ve found out that I need to get webpack to poll files due to the filesystem used in docker for windows mounted volumes, I need to add the below to the webpack configuration but I’m not sure where to add it in the dev.babel.js file (if that is the correct file). I’ve tried adding it in multiple places but I’m not sure if it’s not working or I don’t have the configuration correct.

watchOptions: {
    poll: 1000
}

Any help will be greatly appreciated

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:13 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
tirthbodawalacommented, Nov 13, 2017

@SC7639 I have updated the code to accept watchOptions from config to enable watch config, Please update the file webpack/dev.babel.js by the following option in devServer section:

const commonClientConfig = {
  // ... other config
  devServer: {
    // .. other dev server config 
    watchOptions: {
      aggregateTimeout: 300,
      poll: 1000
    }
  },
};

This should also be updated for service worker configuration just in case, ( I added backup config from above but adding it to service worker would make more sense:

const serviceWorkerConfig = {
  // ... other config
  devServer: {
    // .. other dev server config 
    watchOptions: {
      aggregateTimeout: 300,
      poll: 1000
    }
  },
};

Let me know if this fixes the issue!

0reactions
tirthbodawalacommented, Dec 27, 2018

@aaaleeex7 I think you are posting it in wrong repo 😃 This repo is for ReactPWA. Please raise an issue here: https://github.com/facebook/create-react-app/issues

Read more comments on GitHub >

github_iconTop Results From Across the Web

React hot reload doesn't work in docker container
Currently, if I create a file it recompiles, but if I change something in a file it does not.
Read more >
CRA 5.0 fails to hot-reload in a docker container built ... - GitHub
I am on windows, That may cause the issue. Latest Node docker image : Node.js v17.4.0. Workaround with previous version : Need react-script...
Read more >
Live Reload with Docker and React | by Chavez Harris - Medium
Getting live reload to work in a React docker setup can be a bit difficult and up to a point seem impossible but...
Read more >
Hot Reload on Docker Desktop Windows
The only problem is HOT RELOAD does not work. If you mount a Windows folder into the container and develop in this folder...
Read more >
Docker-compose with WSL 2 React app not hot reloading on ...
You can use WebPack packaging tool, by the way Hot Module Reload is not using on production in most case(Compact bundle will be...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found