gaearon / gaearon/react-hot-loader

FALSE ERROR: react-hot-loader.production.min.js:1 React-Hot-Loader: misconfiguration detected, using production version in non-production environment.

Open
#1,333 7 comments 14 reactions 1 assignee Claimed by @theKashey View on GitHub
Dominant language
JavaScript
Stars
12.2k
Forks
775
PR merge metrics
No merged PRs in 30d

Description

### Description

I'm getting that error message even though RHL seems to be working flawlessly. I've set
`webpack-dev-server --mode development --hot` but same results. Also added to the plugins:

```
new webpack.EnvironmentPlugin({
NODE_ENV: 'development',
}),
```

index.js
```
import React from 'react';
import { AppContainer } from 'react-hot-loader';
import { render } from 'react-dom';
import App from './src/app/containers/App';

render(


,
document.getElementById('app'),
);

if (module.hot) {
module.hot.accept('./src/app/containers/App', () => {
// eslint-disable-next-line global-require
const NextRoot = require('./src/app/containers/App').default;
render(


,
document.getElementById('app'),
);
});
}
```
![Screenshot from 2019-08-31 15-21-57 edited](https://user-images.githubusercontent.com/25909829/64069784-f80cc500-cc05-11e9-89dc-b0a4cb92fa37.png)

I tried using the `hot` api, but RHL **DOES NOT** work with the following setup (it always provokes rull re-rendering of the site):
App.js

```
import { hot } from 'react-hot-loader';
import React from 'react';
...
export default hot(module)(App); // electron complains about using hot(App)
```

So that's why i'm using the _(old)_ index.js approach.

### Environment _(obtained from yarn.lock)_
#### Deps:

- electron 4.2.10
- webpack-cli 3.3.7
- webpack-dev-server 3.8.0
- webpack 4.39.3
- react-hot-loader 4.12.12
- react-router-dom 5.0.1,

#### System:

- OS Ubuntu 18.04 LTS
- node 10.16.2
- npm 6.9.0
- yarn 1.7.3

### Reproducible Demo

This is the repo i'm working on: https://github.com/nahuelarjonadev/kafka-lens/tree/react-hot-loader. Branch react-hot-loader.

Running `yarn` followed by `yarn dev` should be enough to try it.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.