'XMLHttpRequest': The object's state must be OPENED

Just upgraded from 2018 LTS to 2019 LTS and I’m seeing this error a ton in my game. My game uses a ton of web calls.
For what i read online on javascript forums this seems like a game engine bug

‘XMLHttpRequest’: The object’s state must be OPENED."

This issue exists in 2020 too. Might be due to me using the asset BESTHTTP though.

Did you ever get this resolved? We also started seeing this recently after our update from 2019 to 2020, and we also use BestHTTP in our project. I’ve reached out the their support about it, but they seemed convinced it was a problem with Unity.

Ya i don’t have this issue anymore. Think it went away on its own. I just tested web gl again and that error is not there. I remember it was spamming the hell out of console log too in chrome.

I’m on Unity 2020.3.11 now
which version of 2020 you using?

We’re actually using 2021.1.9f1 and the “state must be OPENED” error shows in the chrome console every time we send a web request. Firefox shows a slightly different error: “InvalidStateError: XMLHttpRequest must not be sending.”

I was able to hack a couple changes into the BestHTTP_WebRequest.jslib file to prevent the error messages, though I don’t think what I did was appropriate/release-worthy.

Ya i remember now it did it every time a request was sent for me as well. hmm.
I don’t think it actually effects anything?

correct, the error seems to be superficial… our requests get through to our server correctly, data is logged, and we get a 202 response; though the errors continue to show in the browser console.

it’s beacose of you are setting headers before open() function