Short: overlapping act() calls error — debugging react testing library debugging with hooks
I have been getting this error when debugging react testing library hooks, and wasn’t able to find anything helpful online. I was frustrated, but resolved it after an hour or so.
This is the error message:
ERROR: ‘Warning: You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one.'
The main problem is something in your code is breaking, and that is causing an act
to hang. Debug your code (however you want — console.log
isn’t a bad idea in this scenario), and drill down to where the code is failing. If anyone knows a better way of getting a stack trace/debugging information, I’d love to know.