software-mansion / radon-ide

VSCode extension that turns your editor into a fully fledged IDE for React Native and Expo.
https://ide.swmansion.com
Other
985 stars 33 forks source link

Fix handling of uncaught errors #655

Closed filip131311 closed 3 weeks ago

filip131311 commented 3 weeks ago

This PR fixes the problem with debugger ignoring uncaught errors after reloading JS. Because errors Global Handler was only set on first connection to the debugger it would not be added after reload. The solution was to move the logic of setting the handler to happen on debugger event that is triggered both on first and consecutive application loads.

How Has This Been Tested:

  1. Run Test application and cause error
  2. reload JS
  3. repet step 1). Before the change it would pass the error to the debug console and not stop the application
  4. Test it both on application using RN version older then 76 and 76.

Additional changes: this PR also hides related internal logging from the users debug console

vercel[bot] commented 3 weeks ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
radon-ide ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 24, 2024 4:12pm
kmagiera commented 3 weeks ago

One more thing that comes to my mind here is that you should test this with RN 76 with the new debugger, as it may handle reloads differently compared to old one.

filip131311 commented 3 weeks ago

@kmagiera you were right, the debugger creates execution context in a different moment in RN 76, I changed the approach to accommodate both versions.