mjohnston / react-native-webpack-server

Build React Native apps with Webpack
MIT License
933 stars 84 forks source link

Hot module replacement problem with RN 0.14 #130

Closed paolorovella closed 8 years ago

paolorovella commented 8 years ago

Hi, i've upgraded React Native from 0.12 to 0.14, i've changed react-native-webpack-server with the one in the branch mjohnston/react-native-webpack-server#rn-0.14 and i've tried to put webpack 2.0.0beta ( with new hmr solution from @elliottsj ) but it doesn't work (it gives me an error about BannerPlugin which requires to have only one parameter). So i'm using elliottsj/webpack#web-worker-hack (https://github.com/elliottsj/webpack/tree/web-worker-hack) and with webpack-hot-middleware the webpack dev server is now working.

The problem is that HMR doesn't work anymore :( the React Native Debugger gives me the error GET http://192.168.1.180:8082/__webpack_hmr 404 (Not Found)

Any ideas? @elliottsj @mjohnston Thanks, Paolo

elliottsj commented 8 years ago

Webpack v2.0.0-beta does not yet have my web worker HMR changes; you'll have to use the latest webpack master branch for web worker HMR.

Are you using the rn-0.12-hmr branch of rnws? You'll need that to expose the /__webpack_hmr path.

paolorovella commented 8 years ago

I've solved adding webpack-hot-middleware + webpack-dev-middleware to Server.js in react-native-webpack-server :) thanks

Here my commit https://github.com/paolorovella/react-native-webpack-server/commit/538e2251019f20a97527aaa38dd9fed4457ea83b