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.

"Maximum update depth exceeded" when clicking the image

See original GitHub issue

I have been getting this error and it looks like it was introduced recently. At first I assumed it was an issue in my local setup, but I can reproduce it in the demo.

It seems to come from the fact that the onChange gets called in an infinite loop.

  • Version: 6.0.7
  • Steps to reproduce:
    1. open demo (Tried in Firefox and Chrome)
    2. upload an image
    3. click anywhere in the image
    4. notice React Error
  • Error:

Invariant Violation Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.

image

Note: rolling back to v6.0.5 fixes it.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
DominicTobiascommented, Jan 23, 2019

@noashka Please try 6.0.12 this issue should be fixed now. It was proving too problematic to try and fix/complete invalid aspect crops every component update/render, so I just fix/complete them if they are incorrect on image load

0reactions
DominicTobiascommented, Jan 24, 2019

Great thanks for checking

On Thu, 24 Jan 2019 at 11:03, Vadim notifications@github.com wrote:

@DominicTobias https://github.com/DominicTobias You’ve fixed it! Thank you for help!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/DominicTobias/react-image-crop/issues/218#issuecomment-457157757, or mute the thread https://github.com/notifications/unsubscribe-auth/AAuZ-poQ31IvaJQwT0aLGBYIgWHtrsSgks5vGZMfgaJpZM4YeCHZ .

Read more comments on GitHub >

github_iconTop Results From Across the Web

React error: warning maximum update depth exceeded
Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency ...
Read more >
Fix the "Maximum Update Depth Exceeded" Error in React
One quick solution is to move the function inside the useEffect hook. ... We can see that now incrementViews is scoped inside the...
Read more >
How to Fix Maximum Update Depth Exceeded in React and ...
In this video, I show you several ways the dreaded " Max Update Depth Exceeded " error commonly occurs in React and React...
Read more >
React - maximum update depth exceeded - CodeProject
My code is in my GitHub repo. The file where the error occured is in my App. js file.
Read more >
[Solved]-Maximum update depth exceeded-Reactjs
[Solved]-Maximum update depth exceeded-Reactjs. Search. score:3. Accepted answer. clicked={() => this.postClicked(el.id)})}. Colin Ricardo 15240.
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