gaearon / gaearon/react-hot-loader

Super expression must either be null or a function, not undefined

Open
#900 16 comments 2 reactions 1 assignee Claimed by @theKashey View on GitHub
bug
Dominant language
JavaScript
Stars
12.2k
Forks
775
PR merge metrics
No merged PRs in 30d

Description

If you are reporting a bug or having an issue setting up React Hot Loader, please fill in below. For feature requests, feel free to remove this template entirely.

### Description

What you are reporting:
I am either reporting a bug or documentation is misleading.

### Expected behavior

What you think should happen: I should be able to build a production version of my app with react-hot-loader and RHL should not be executed in production as it says in docs.

### Actual behavior

What actually happens:

I have created simple setup using webpack 4 and react-hot-loader 4. When I run my build script (which is just a standard `webpack` command) and run app in browser I receive error from RHL:
Uncaught TypeError: Super expression must either be null or a function, not undefined

This error goes away when I remove `react-hot-loader/babel` from `plugins` entry in `.babelrc`. This leads me to believe I should actually have a separate babel setup for production and development.

### Environment

React Hot Loader version: 4.0.0

Run these commands in the project folder and fill in their results:

1. `node -v`: 8.7.0
2. `npm -v`: 5.5.1

Then, specify:

1. Operating system: Ubuntu 16.04 LTS
2. Browser and version: Chrome 65

### Reproducible Demo

Please take the time to create a new project that reproduces the issue.

You can copy your project that experiences the problem and start removing things until you’re left with the minimal reproducible demo. This helps contributors, and you might get to the root of your problem during that process.

Push to GitHub and paste the link here.
https://github.com/apieceofbart/react-hot-loader-webpack-4-example

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.