Skip to content

[4.0.0-beta.7] React-hot-loader: wrong configuration #750

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

Closed
katmai7 opened this issue Dec 29, 2017 · 6 comments
Closed

[4.0.0-beta.7] React-hot-loader: wrong configuration #750

katmai7 opened this issue Dec 29, 2017 · 6 comments
Labels

Comments

@katmai7
Copy link

katmai7 commented Dec 29, 2017

After updating from 4.0.0-beta6 to 4.0.0-beta7 version, I've gotten an error React-hot-loader: wrong configuration.

It looks like I import and use hot loader correctly

import React from 'react';
import { hot } from 'react-hot-loader';
// other imports

function renderRouter() {
  return (
    <Router5Provider router={router}>
      <ReactRouter history={history}>
        {routesFactory(store)}
      </ReactRouter>
    </Router5Provider>
  );
}

export default hot(module)(renderRouter);

I've tried to import hot-loader before React, but nothing changed.

React Hot Loader version: 4.0.0-beta.7

  1. node -v: 8.9.1

  2. npm -v: 5.6.0

  3. Operating system: OS X El Capitan 10.11.6

  4. Browser and version: Chrome 63.0.3239.84

@gregberge
Copy link
Collaborator

@katmai7 can you try with v4.0.0-beta.8?

@theKashey
Copy link
Collaborator

@katmai7 - it should contain more extended information, written by console.error just before triggering an error.
The problem may be not in this file, but somewhere before, or after it - RHL just detects component which uses the unpatched version of React, and report about it.

How to solve completely - import 'react-hot-loader' in the index.js, ie before any other your file. Just import, nothing more.
Anyway - it is better to trace the problem or provide some reproducible demo, and we will trace it.

@gregberge
Copy link
Collaborator

gregberge commented Dec 29, 2017

@theKashey you mean import 'react-hot-loader/patch' I think. You can also put in webpack.config.js entry just like in v3.

@theKashey
Copy link
Collaborator

react-hot-loader will import index.dev, it will import AppContainer.dev, it will import patch.dev :)
So you can just import react-hot-loader.

@gregberge
Copy link
Collaborator

Should be definitively fixed in 4.0.0-beta.9.

@skipjack
Copy link

Just in case anyone else runs into this -- I ran into this error when duplicate copies of react were included in a site. This can happen for a variety of reasons including when a package is npm linked that also has react installed.

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

No branches or pull requests

4 participants