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.

Warning: flushSync was called from inside a lifecycle method

See original GitHub issue

Version

6.0.0-alpha.11

Steps to reproduce

It happens in a fairly large project, but not on CodeSandbox sample, and I did not have time to bisect properly. If it’s obvious to you what the issue is, great, otherwise feel free to close and I will re-open when I have a better repro.

Fwiw, it does not happen with 5.x.

Actual Behavior

Warning: flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task.
Menu2
Overlay2
div
RootClose2
TypeaheadManager2
Typeahead2
TypeaheadComponent2
MyComponent

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:11
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
mjakalcommented, Jun 24, 2022

Maybe it’s related to node/npm version. I’m using node v16.14.0 and npm v8.3.1. on my dev machine.

1reaction
ericgiocommented, Jul 4, 2022

I think this should be fixed in v6.0.0-rc.3; I can no longer repro the issue in a sandbox using that version. I believe the issue was caused by Menu inadvertently calling PopperJS’s forceUpdate function on every render, which shouldn’t happen any more.

Read more comments on GitHub >

github_iconTop Results From Across the Web

flushSync React warning occurs on render() for Modal that ...
Warning: flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call ...
Read more >
react-bootstrap-typeahead error: flushSync was called from ...
js:24447 Uncaught Error: flushSync was called from inside a lifecycle method. It cannot be called when React is already rendering. Below is the ......
Read more >
Have you used `flushSync` in React? - DEV Community ‍ ‍
To use flushSync , we need to import it from react-dom : import { flushSync } from "react-dom";. And now we can wrap...
Read more >
Warning: flushSync was called from inside a lifecycle method
Version. 6.0.0-alpha.11. Steps to reproduce. It happens in a fairly large project, but not on CodeSandbox sample, and I did not have time...
Read more >
React flushSync() - CodingShower
The ReactDOM.flushSync(callback) API method synchronously flushes all the updates inside the callback passed, into the DOM immediately.
Read more >

github_iconTop Related Medium Post

No results found

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