0

I'm having an issue in Internet Explorer while applying polyfills in react app which was created using CRA. After request to an api endpoint, a javascript error TypeError: Can't redefine non-configurable property 'error' fires even if the request response is a success. There is also no cule where it fires the error. Fetch is used for async requests. I tried to replace it with axios but it still fires the same error.

Update: Tried with sourcemaps as well but no luck. Here is the Error. It's in Turkish but translates to "TypeError: Can't redefine non-configurable property 'error'" enter image description here

5
  • Could you please provide a minimal code snippet which can reproduce the issue? So that we can have a test and see how to help. With only the above text description, we can't locate the issue. Besides, about the error, you can refer to this doc for more information.
    – Yu Zhou
    Commented Nov 15, 2021 at 5:46
  • I’ve read the documentation but the thing is the error happens in the bundled js file and it is impossible to understand where the error is coming from. It is generated code and there is no way I could find to make that object configurable. And, unfortunately the project is pretty large and there are lots of packages included which is not easy. Thanks for your comment. Commented Nov 15, 2021 at 18:46
  • If so, you can try to use source maps to debug the code. Source maps map your compiled code back to your original source code. Source maps are generated by default in production mode in CRA. You can refer to this variable GENERATE_SOURCEMAP in this doc.
    – Yu Zhou
    Commented Nov 17, 2021 at 8:37
  • No luck with the sourcemaps Commented Nov 17, 2021 at 15:30
  • As I mentioned, it's hard to debug without a reproducible code snippet. You can also open an issue on CRA GitHub to see if there's any solution.
    – Yu Zhou
    Commented Nov 19, 2021 at 9:51

0