exceptionless / Exceptionless.JavaScript

Exceptionless JavaScript client
http://exceptionless.com
Apache License 2.0
59 stars 24 forks source link

Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. #76

Closed leidegre closed 3 years ago

leidegre commented 6 years ago

Got some more information regarding the origin of that Synchronous XMLHttpRequest. Throughout we could use this as a place to discuss and troubleshoot further.

[Deprecation] Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.
loadSource @ exceptionless.js:411
getSource @ exceptionless.js:446
gatherContext @ exceptionless.js:500
computeStackTraceFromStackProp @ exceptionless.js:791
computeStackTrace @ exceptionless.js:1162
traceKitWindowOnError @ exceptionless.js:199
invokeGuardedCallbackDev @ react-dom.development.js:1338
invokeGuardedCallback @ react-dom.development.js:1195
performWork @ react-dom.development.js:12800
scheduleUpdateImpl @ react-dom.development.js:13185
scheduleUpdate @ react-dom.development.js:13124
enqueueSetState @ react-dom.development.js:9646
webpackJsonp../node_modules/react/cjs/react.development.js.ReactComponent.setState @ react.development.js:218
(anonymous) @ async-component.js:25
Promise resolved (async)
render @ async-component.js:23
finishClassComponent @ react-dom.development.js:10249
updateClassComponent @ react-dom.development.js:10226
beginWork @ react-dom.development.js:10605
performUnitOfWork @ react-dom.development.js:12573
workLoop @ react-dom.development.js:12682
callCallback @ react-dom.development.js:1299
invokeGuardedCallbackDev @ react-dom.development.js:1338
invokeGuardedCallback @ react-dom.development.js:1195
performWork @ react-dom.development.js:12800
batchedUpdates @ react-dom.development.js:13244
performFiberBatchedUpdates @ react-dom.development.js:1646
stackBatchedUpdates @ react-dom.development.js:1637
batchedUpdates @ react-dom.development.js:1651
batchedUpdatesWithControlledComponents @ react-dom.development.js:1664
dispatchEvent @ react-dom.development.js:1874
niemyjski commented 6 years ago

We use trace kit (https://github.com/csnover/TraceKit, which we help maintain) which is causing this message.

https://github.com/csnover/TraceKit/blob/master/tracekit.js#L401

This library supports everything back to IE6. Perhaps we need to look into a better way to lookup the source method or disable this functionality behind a flag (it's trying to look up the source so it can get line numbers).

niemyjski commented 6 years ago

I'm not sure what all we could do except for updating this library. The problem is, this library doesn't support promises because it has to work in every browser so it's always going to be a sync request. I wonder what would be best here. If there is a way to do this with a different api. Is there any chance you could look into this?

leidegre commented 6 years ago

Absolutely, I'll keep this open and look at it from time to time. I don't have a window right now but I'll get back to it.

santiagomolinadecastro commented 5 years ago

How can i make Synchronous XMLHttpRequest? I need make my call sync. Are there alternatives? It was deprecated in XMLHttpRequest. Thanks!

niemyjski commented 5 years ago

I'm not aware of any, I know there are warnings currently about it being deprecated.

niemyjski commented 3 years ago

We just merged in our 2.0 rewrite and I'll be updating the readme and then cutting a release. Is there any chance you could try out the 2.0.0-beta when we tag it. We've made fetch the default implementation and also implemented source maps.