question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

useEffect fails with `Cannot set property 'lastEffect' of null` in production mode

See original GitHub issue

Do 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:

image

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:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
steadicatcommented, Oct 29, 2018

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).

Read more comments on GitHub >

github_iconTop Results From Across the Web

React: Cannot set property 'lastEffect' of null - Stack Overflow
I am getting below error in production. Looks like it's related to uglisify Webpack plugin I can't find solution to resolve it.
Read more >
[Solved]-React: Cannot set property 'lastEffect' of null-Reactjs
This is caused by uglifyjs-webpack-plugin version 2.0.1 in React 16.7.0-alpha as it breaks the new hook feature of React.
Read more >
Synchronizing with Effects - React Docs
In other words, useEffect “delays” a piece of code from running until that render is reflected on the screen. Let's see how you...
Read more >
https://git.progress-linux.org/packages/fuchur/fir...
Try triggering the error in production mode, ' + 'or switching to a modern ... null)) { { throw Error( "Unable to find...
Read more >
react-dom.js.source.txt
The attribute name is case-sensitive in SVG so we can't just use // the React name ... Try triggering the error in production...
Read more >

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found