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.