0

I am using next.js and I need to send an AJAX request (I am using isomorphic-unfetch). Some cases the response is with 302 HTTP status code and I need to redirect to the URL that comes in response. For redirecting, I have tried with Router.push(url) and window.location.href=url due is a client redirection.

The problem is that in IE11 appears the error (other browsers works well) enter image description here

The redirection is done but it takes about 10 seconds. I was googling and found this SCRIPT7002: XMLHttpRequest: Network Error 0x2ef3, Could not complete the operation due to error 00002ef3 that describe a bit my problem but none of the proposed solutions fixed my problem. Other posts suggest changing the status response but I have no control to the requested endpoint so I can't change anything. Any ideas on how to solve this?

Hector Davila
  • 180
  • 2
  • 10
  • 1
    You can refer to [this thread](https://github.com/NodeBB/NodeBB/issues/3587) and [this thread](https://stackoverflow.com/questions/31847078/script7002-xmlhttprequest-network-error-0x2f76-could-not-complete-the-operati), then, try to change the redirect code from 302 to 308. – Zhi Lv May 09 '19 at 02:23
  • @ZhiLv-MSFT thanks for your response but I can't change the redirect code, I have no control over the backend – Hector Davila May 09 '19 at 02:30

0 Answers0