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

Is there a way to enable hot module replacement #2

Closed
iEricKoh opened this issue Jan 28, 2016 · 4 comments
Closed

Is there a way to enable hot module replacement #2

iEricKoh opened this issue Jan 28, 2016 · 4 comments

Comments

@iEricKoh
Copy link

@iansinnott I'm familiar with the webpack-dev-server and have used it quite a bit. But in webpack-dev-middleware, I have no idea on how to get hot module replacement working in this project.

Currently there is a error message from HMR on chrome console after I save my changes in the file.

[HMR] The following modules couldn't be hot updated: (Full reload needed)
This is usually because the modules which have changed (and their parents) do not know how to hot reload themselves. See http://webpack.github.io/docs/hot-module-replacement-with-webpack.html for more details.

Could you please give me some advice on hot-module-replacement with webpack-dev-middleware? thanks.

Also, are you going to upgrade version of babel from 5.. to 6..?

@iansinnott
Copy link
Owner

Hm, that's odd. HMR works for me when I'm running this project (i.e. npm start). Can you point me to a repo where I can reproduce the issue?

Something to note is that HMR doesn't usually work with the root component. I haven't found explicit documentation on this yet but in my experience changes to a root component require a full reload.

Another issue may be functional components. According to the repo we're using functional components are not yet supported for HMR, only React.createClass or class Blah extends React.Component type components are supported. See this issue for details.

@iEricKoh
Copy link
Author

iEricKoh commented Feb 1, 2016

@iansinnott Thanks for your updated.

I've try and test again, it's a functional components problem. Thanks.

@iansinnott
Copy link
Owner

👍

@gaearon
Copy link

gaearon commented Apr 18, 2016

React Hot Loader 3 supports functional components without destroying the state.
It supersedes both React Hot Loader and React Transform, and is built on lessons learned from both.
Check it out: gaearon/react-hot-boilerplate#61

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

3 participants