question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Synchronous XMLHttpRequest on the main thread is deprecated

See original GitHub issue

When running less.js in Chrome Canary (39.0.2171.95) I get a warning in the console

Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check http://xhr.spec.whatwg.org/.

We are running into the same problem in Firefox and IE: there is a big FOUC while less is downloading files.

Is there a way to prevent this ? I understand the rationale of the deprecation, but for devs, it’s still needed…

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
matthew-deancommented, Jan 11, 2017

@nitriques This is already released. “async” is no longer applied to the XHR request. Instead, it controls whether the page displays before or after the style sheet is created.

1reaction
matthew-deancommented, Nov 27, 2015

I’ve fixed this issue pretty much exactly the way I suggested. Just needs code review for merging.

Btw, for me, changing the sync XHR to a “fake sync” (preventing FOUC) changed the render time for my stylesheets from 7-10 seconds to somewhere around a second. So, quite an improvement.

Read more comments on GitHub >

github_iconTop Results From Across the Web

JavaScript console.log causes error: "Synchronous ...
Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience.
Read more >
Synchronous XMLHttpRequest on the main thread is deprecated
Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help http://xhr.spec.
Read more >
[SOLVED] XMLHttpRequest on the Main Thread is Deprecated
Hi @adrian, I am using a custom pw-panel and on page load, the first time I hover over its 'open' button, I get...
Read more >
Synchronous XMLHttpRequest on the main ... - This Interests Me
This method has been deprecated because it can cause huge delays for scripts in the main document. In plain English, that means that...
Read more >
Synchronous XMLHttpRequest on the main ... - jQuery Forum
Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience - jQuery Forum.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found