Skip to content
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

HMR does not work anymore #230

Closed
TheAifam5 opened this issue Nov 16, 2018 · 11 comments
Closed

HMR does not work anymore #230

TheAifam5 opened this issue Nov 16, 2018 · 11 comments

Comments

@TheAifam5
Copy link

TheAifam5 commented Nov 16, 2018

Hey,
I noticed that the HMR does nothing now, like does not watch for changes or something. After when I edit a file, nothing happens.

I tested also the provided example (https://github.com/electron-userland/electron-webpack-quick-start), and I had the same issue with it.

Example:
tet.zip

Regards,
TheAifam5

@PerfectionVR
Copy link

Funny that this is posted as I have been working on the same issue for the last 1 hour. I tried updating packages and looking around but to no avail.

In console

[HMR] Waiting for update signal from WDS...
[WDS] Hot Module Replacement enabled.

Then nothing.

My renderer.tsx

require('electron-react-devtools').install();
require('react-hot-loader/patch');
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import { AppContainer } from 'react-hot-loader';
import App from './layout/app';

const render = (Component: any) => {
  ReactDOM.render(
    <AppContainer>
      <Component />
    </AppContainer>,
    document.getElementById('app')
  );
};

render(App);

if (module.hot) {
  module.hot.accept('./layout/app', () =>
    render(require('./layout/app').default)
  );
}

and my package.json

  "dependencies": {
    "bootstrap": "^4.1.3",
    "jquery": "^3.3.1",
    "mobx": "^5.6.0",
    "mobx-react": "^5.3.6",
    "popper.js": "^1.14.5",
    "react": "^16.6.3",
    "react-dom": "^16.6.3",
    "react-router-dom": "^4.3.1",
    "source-map-support": "^0.5.9"
  },
  "devDependencies": {
    "@babel/core": "^7.1.6",
    "@babel/preset-react": "^7.0.0",
    "@types/enzyme": "^3.1.15",
    "@types/enzyme-adapter-react-16": "^1.0.3",
    "@types/jest": "^23.3.9",
    "@types/react": "^16.7.6",
    "@types/react-dom": "^16.0.9",
    "@types/react-router-dom": "^4.3.1",
    "electron": "^3.0.9",
    "electron-builder": "^20.36.1",
    "electron-react-devtools": "^0.5.3",
    "electron-webpack": "^2.6.0",
    "electron-webpack-eslint": "^4.0.0",
    "electron-webpack-ts": "^3.0.0",
    "enzyme": "^3.7.0",
    "enzyme-adapter-react-16": "^1.7.0",
    "eslint": "^5.9.0",
    "eslint-config-prettier": "^3.3.0",
    "eslint-loader": "^2.1.1",
    "eslint-plugin-jest": "^22.0.0",
    "eslint-plugin-prettier": "^3.0.0",
    "eslint-plugin-react": "^7.11.1",
    "eslint-plugin-typescript": "^0.13.0",
    "jest": "^23.6.0",
    "jest-enzyme": "^7.0.1",
    "jest-junit": "^5.2.0",
    "less": "^3.8.1",
    "less-loader": "^4.1.0",
    "prettier": "^1.15.2",
    "react-hot-loader": "^4.3.12",
    "rimraf": "^2.6.2",
    "ts-jest": "^23.10.4",
    "tslint": "^5.11.0",
    "typescript": "^3.1.6",
    "typescript-eslint-parser": "^21.0.1",
    "webpack": "^4.25.1"
  },
``

@TheAifam5
Copy link
Author

TheAifam5 commented Nov 16, 2018

@PerfectionCSGO exactly the same issue I have... 1:1 :D Its so annoying that I lost the whole day debugging my app, changing settings, tsconfig, packages... Then I decided to make a new account on my PC, because I was thinking that maybe it's a problem with cache or something but that does not help.

The best thing, yesterday was everything ok. I tried also to downgrade the package and nothing but looks like, one of the upstream packages got an update and that breaks maybe whole HMR. After downgrading I got the same issues so - that's why I was drilling my config files :D

@cmeeren
Copy link

cmeeren commented Nov 17, 2018

I too have this issue. 2.3.1 works, 2.6.0 doesn't. (I'm on windows and can't test the versions between these due to #223).

The symptoms, as previously mentioned, is that it doesn't seem to watch the files - the console doesn't react when changing files.

@jbondeson
Copy link

Just stepped through and it broke in 2.4.0.

I happen to be on macOS 10.14.1 (Mojave) so it's not a platform specific thing.

@jyoung295
Copy link

I had the same issue with 2.4.0 and 2.6.0. It was causing me some other issues; after packaging and building my app I'd have to restart my computer to get electron-webpack dev to properly compile again.

I've reverted to 2.3.1 and everything is working perfectly again.

I'm on macOS 10.14.1 also.

@manferlo81
Copy link

same issue here, I rolled back to v2.3.1 for now.

@jhchill666
Copy link

Confirmed downgrading to v2.3.1 fixes

@geraldbiggs
Copy link

Confirmed downgrading 2.3.1 on Ubuntu 18

@polarathene
Copy link

polarathene commented Jan 27, 2019

@develar Whatever the changes were, they don't appear to solve the issue. I am using electron-webpack 2.6.2 via the quick-start project, but still experiencing broken HMR.

EDIT: Nvm. Seems to be something related to my system, nothing was changed and no commands run on default quickstart project and HMR was working correctly.

@sigmasoldi3r
Copy link

sigmasoldi3r commented May 18, 2019

I have the same issue @polarathene after adding typescript support and react, wonde what can cause the issue...

Edit: In fact, HMR is stuck at waiting:

[HMR] Waiting for update signal from WDS...

@polarathene
Copy link

@sigmasoldi3r If the system has been running for a while or has a lot of things open, consider a restart. It might be something due to file watchers/handlers that raising your inotify/inodes limit might fix if that's the case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants