You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Refactor DOMException handling code to avoid redundant exceptions generation #724
Hello, we are the development team of VS Code extension for debugging React Native apps (vscode-react-native). whatwg-fetch package is used in React Native lib. In our extension we debug React Native apps as a Node.js processes. Node JS global context doesn't contain DOM modules, so "exports.DOMException is not a constructor" exception is generated in whatwg-fetch package if fetch function is used in a React Native project.
Could it be better to firstly verify if there is DOMException module in environment global context and only after that use try/catch construction? If DOMException module doesn’t exist it can be better to create this module without exception generation.
Here is the issue for the corresponding case in the debugger extension repository.
Reacted by Can Poyrazoğlu, XggoiDZ and André Kovac
This really becomes counterproductive when All Exceptions checkbox is enabled as this is hit everytime the app is restarted. I'd like to leave All Exceptions on, but can't because of this being hit each time, causing me to lose my focus, hit continue, go back to the file that I was working on etc.
@andrekovac exactly. I've got so many dependencies, none of them causing anything like this. It's only fetch, and causing whole (already-slow) debugger to step everytime I restart my RN app, and no one is even willing to fix it. I think I'll just switch to something else like axios if none of my dependencies explicitly depend on fetch.
@canpoyrazoglu, you yourself are not willing to fix this. This is an open source project worked on by people in their spare time. You can just as easily fix the issue yourself.
Activity
canpoyrazoglu commentedon Nov 21, 2019
This really becomes counterproductive when
All Exceptionscheckbox is enabled as this is hit everytime the app is restarted. I'd like to leaveAll Exceptionson, but can't because of this being hit each time, causing me to lose my focus, hit continue, go back to the file that I was working on etc.andrekovac commentedon May 5, 2020
Would be great if this issue could be taken into consideration!
canpoyrazoglu commentedon May 5, 2020
@andrekovac exactly. I've got so many dependencies, none of them causing anything like this. It's only fetch, and causing whole (already-slow) debugger to step everytime I restart my RN app, and no one is even willing to fix it. I think I'll just switch to something else like axios if none of my dependencies explicitly depend on fetch.
JakeChampion commentedon Jul 9, 2020
@canpoyrazoglu, you yourself are not willing to fix this. This is an open source project worked on by people in their spare time. You can just as easily fix the issue yourself.
Detect if DOMException exists via typeof instead of trying to call it…
JakeChampion commentedon Jul 9, 2020
That took 3 minutes to fix. #797
Detect if DOMException exists via typeof instead of trying to call it…
Detect if DOMException exists via typeof instead of trying to call it…