useEffect fails with `Cannot set property 'lastEffect' of null` in production mode
See original GitHub issueDo you want to request a feature or report a bug? Bug.
What is the current behavior?
When rendering a component that calls useEffect
in production mode, React crashes with Cannot set property 'lastEffect' of null
.
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn’t have dependencies other than React. Paste the link to your JSFiddle (https://jsfiddle.net/Luktwrdm/) or CodeSandbox (https://codesandbox.io/s/new) example below: I’m still working on reproducing locally. Meanwhile, here’s the relevant error from Sentry:

What is the expected behavior? No error.
Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React? 16.7.0-alpha.0.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:8 (3 by maintainers)
Sure thing: https://github.com/webpack-contrib/uglifyjs-webpack-plugin/issues/374.
Sorry for the delay. Here’s a simple repo that repros: https://github.com/steadicat/react-useeffect-test
The code is pretty straightforward. The bug seems to be caused by the latest version of
uglifyjs-webpack-plugin
(2.0.1).