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

ReactHot triggers error when update any component #77

Closed
edygar opened this issue Feb 12, 2015 · 12 comments
Closed

ReactHot triggers error when update any component #77

edygar opened this issue Feb 12, 2015 · 12 comments

Comments

@edygar
Copy link
Contributor

edygar commented Feb 12, 2015

I've made a minimal sample code to illustrate the problem, whenever I change any code, I got the following error on browser's console:

Uncaught RangeError: Maximum call stack size exceeded  bundled.js:713
hotAddUpdateChunk  bundled.js:5
webpackHotUpdateCallback  bundled.js:6
webpackHotUpdateCallback  bundled.js:6
webpackHotUpdateCallback  bundled.js:6
...

Where bundled.js:6 is:

/******/    function hotAddUpdateChunk(chunkId, moreModules) {
@gaearon
Copy link
Owner

gaearon commented Feb 12, 2015

Thanks for the test case. I'll take a look later in the evening.

@gaearon
Copy link
Owner

gaearon commented Feb 13, 2015

This is one of those annoying cases where CLI version of webpack-dev-server does not behave like its Node API for some reason. I'll file a bug report in Webpack.

For now, creating server.js with this code and running it as npm run dev solves the problem:

var webpack = require('webpack');
var WebpackDevServer = require('webpack-dev-server');
var config = require('./webpack.config');

new WebpackDevServer(webpack(config), {
  publicPath: config.output.publicPath,
  hot: true
}).listen(8080, 'localhost', function (err, result) {
  if (err) {
    console.log(err);
  }

  console.log('Listening at localhost:8080');
});

@gaearon
Copy link
Owner

gaearon commented Feb 13, 2015

Filed as webpack/webpack-dev-server#106. Hopefully we can get it fixed once and for all, now that you provided the repro!

@edygar
Copy link
Contributor Author

edygar commented Feb 13, 2015

Nice! I didn't know the problem was in webpack-dev-server's CLI, thank you for the reply and the opened issue there...

Should we close this issue or let it open until webpack/webpack-dev-server#106 gets solved?

@gaearon
Copy link
Owner

gaearon commented Feb 13, 2015

Let's leave it open so it's visible.

@herebebeasties
Copy link

As a commenter in webpack-dev-server/issues/87 says, you're probably tripping over this because you have both --hot on the CLI and also a new HotModuleReplacementPlugin() being added in your webpack.config.js.

@edygar
Copy link
Contributor Author

edygar commented Mar 7, 2015

@herebebeasties confirmed! Now I just check if --hot flag is present before add new HotModuleReplacementPlugin() and it just works

@edygar edygar closed this as completed Mar 7, 2015
@gaearon
Copy link
Owner

gaearon commented Mar 7, 2015

Can I ask you to add this to Troubleshooting doc page?

@edygar
Copy link
Contributor Author

edygar commented Mar 7, 2015

Sure you can! Later today, ok?

@gaearon
Copy link
Owner

gaearon commented Mar 7, 2015

Thanks!

tomzaoral added a commit to tomzaoral/react-firebase-boilerplate that referenced this issue Jul 22, 2015
Hot reloading now preserve the state of React components.

HMR plugin removed. Explained here
gaearon/react-hot-loader#77
@philihp
Copy link

philihp commented Oct 23, 2015

Found this issue because I, too, had --hot and in my plugins new HotModuleReplacementPlugin().

@crobinson42
Copy link

Found this issue because I, too, had --hot and in my plugins new HotModuleReplacementPlugin()

I removed webpack.HotModuleReplacementPlugin() from my plugins and left the --hot and it works as expected, now.

webgurucan pushed a commit to webgurucan/react-hot-loader that referenced this issue Mar 26, 2022
dluoulb pushed a commit to dluoulb/hs7-react-hot-loader that referenced this issue Jan 31, 2024
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

5 participants