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

React + Hot Reload - Doesn't work after exporting in it's update! #2

Closed
kosiakMD opened this issue Sep 5, 2016 · 3 comments
Closed

Comments

@kosiakMD
Copy link

kosiakMD commented Sep 5, 2016

Module build failed: Error: React Hot Loader: The Webpack loader is now exported separately. If you use Babel, we recommend that you remove "react-hot-loader" from the "loaders" section of your Webpack configuration altogether, and instead add "react-hot-loader/babel" to the "plugins" section of your .babelrc file. If you prefer not to use Babel, replace "react-hot-loader" or "react-hot" with "react-hot-loader/webpack" in the "loaders" section of your Webpack configuration.
at Object.warnAboutIncorrectUsage (/Users/{USER}/{Desktop}/{Projects}/{redux_test}/node_modules/react-hot-loader/lib/index.js:7:11)
@ multi main

was added "react-hot-loader/babel" to the "plugins" section of your .babelrc file
and/or replaced "react-hot-loader" or "react-hot" with "react-hot-loader/webpack" in the "loaders" section of my Webpack configuration.

NOTHING HELPED!

@maxfarseer
Copy link
Owner

Try to use old versions of packages (see package.json file)

@kosiakMD
Copy link
Author

kosiakMD commented Sep 6, 2016

Good for the first time ;)
It would be great if you'll resolve this issue!

@maxfarseer maxfarseer added bug and removed bug labels Sep 8, 2016
@suprekaka
Copy link

It seems that you use the react-hot-loader@3.0.0-beta.x
You can use react-hot-loader@1.3.0 to solve this problem.
If you want to use the new features, please refer to https://github.com/gaearon/react-hot-boilerplate/tree/next (note the branch is next).

You must have below code in your app container :

const rootEl = document.getElementById('root');
ReactDOM.render(
  <AppContainer>
    <App />
  </AppContainer>,
  rootEl
);

if (module.hot) {
  module.hot.accept('./App', () => {
    // If you use Webpack 2 in ES modules mode, you can
    // use <App /> here rather than require() a <NextApp />.
    const NextApp = require('./App').default;
    ReactDOM.render(
      <AppContainer>
         <NextApp />
      </AppContainer>,
      rootEl
    );
  });
}

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