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

webpack loader: TypeError: Cannot read property 'indexOf' of undefined #1234

Open
yang opened this issue Apr 26, 2019 · 3 comments
Open

webpack loader: TypeError: Cannot read property 'indexOf' of undefined #1234

yang opened this issue Apr 26, 2019 · 3 comments

Comments

@yang
Copy link

yang commented Apr 26, 2019

Description

What you are reporting:

Bug (or my own misunderstanding). I'm trying to get a basic create-react-app working with hot-loader via the webpack-loader rather than the babel-loader, since I want to use sucrase rather than babel.

Expected behavior

What you think should happen:

Adding webpack-loader should work.

Actual behavior

What actually happens:

Running yarn start spits this error:

./node_modules/@hot-loader/react-dom/cjs/react-dom.development.js
TypeError: Cannot read property 'indexOf' of undefined

Environment

React Hot Loader version:

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

  1. node -v: 10.15.1
  2. npm -v: 6.8.0
  3. yarn -v: 1.13.0

Then, specify:

  1. Operating system: MacOS 10.14.4
  2. Browser and version: Chrome 73.0.3683.103

Reproducible Demo

I just did create-react-app, eject, and added hot-loader:

https://github.com/yang/hot-cra-webpack-loader-repro

@wmertens
Copy link

wmertens commented May 9, 2019

Interesting, I got the same error but from react-hot-loader/webpack.js - see full stack at #1243

@theKashey
Copy link
Collaborator

webpack-loader is trying to patch already patched hot-loader/react-dom, which is also not required.

@theKashey
Copy link
Collaborator

Fixed in v4.8.5

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