Skip to content

Conversation

@xlc
Copy link
Contributor

@xlc xlc commented Aug 20, 2025

Closes #82

Without this, everytime configure is called due to hot reload, console.log will have 1 extra stack, and with enough hot reloads, it will stackoverflow, but will be triggered by until.inspect, which internally uses str.replace and throw "Maximum regex stack depth reached" error

Summary of Changes:

  • This change prevents the console object from being patched multiple times by adding a guard in the enableConsoleCapture method.
  • The configure method has been updated to correctly disable console capturing when the captureConsole option is set to false.

@alois-beto
Copy link
Contributor

Great find, I had never thought of that possibility. I'll go ahead and merge it right away and create a new release. Thank you very much for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Maximum regex stack depth reached" when hot realoads with Expo

2 participants