Hello,

When Quickedit is activate I have got this message in the browser console : Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience.
However, the module works well Some users report Quickedit not working at all when they get this warning message.

When I try to find the bug in Quickedit.js, this line is cause of problem :
entityElement.setAttribute('data-quickedit-entity-instance-id', entityInstanceID);

Thanks in advance.

CommentFileSizeAuthor
#14 Screen Shot 2017-02-09 at 11.02.07 AM.png290.37 KBjsulmar
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

musikscontact created an issue. See original summary.

Wim Leers’s picture

Title: Synchronous XMLHttpRequest on Quickedit module » Browser console warning: "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/."
Component: quickedit.module » ajax system
Status: Needs review » Active
Issue tags: +JavaScript

Thanks for reporting this! This warning has also bothered me a lot.

When trying to find the root cause, it blames jQuery.ajax(). When I set breakpoints in there, Chrome doesn't allow me to inspect any of the variables. When I add logging, Chrome doesn't log it. What the hell?

In any case, Quick Edit doesn't do anything special, it merely uses the AJAX system.

droplet’s picture

Insertion of the SCRIPT tag caused the problem.
https://github.com/jquery/jquery/issues/1895

Wim Leers’s picture

Issue tags: +Needs upstream bugfix

Aha!

sukanya.ramakrishnan’s picture

any updates on this one? am getting this error with an ajax view and once this errors throws up custom javascript behaves very inconsistently?

regards
Sukanya

DanielVeza’s picture

I just had the same issue as sukanya.ramakrishnan.

While the notice was there my custom JS wouldn't work correctly. As soon as I disabled quickedit the warning disappeared and the js worked as expected.

droplet’s picture

In general, the warning won't break the JS executions but slow down the responses. What's your browser version? and any steps to reproduce?

Looking at Network Tab in Chrome for the JS loading. If you can, right click and save the HAR in network and Timeline data to us.

Could it be this issue?
#1988968: Drupal.ajax does not guarantee that "add new JS file to page" commands have finished before calling said JS
(Even not this issue, the patch may sort the problem. It loads JS async instead)

Wim Leers’s picture

(Even not this issue, the patch may sort the problem. It loads JS async instead)

Indeed.

jimafisk’s picture

DanielVeza - Thanks for the tip in #6, that worked for me. Disabling QuickEdit allowed my custom javascript to work properly again.

droplet’s picture

@Wim,

Can we defer that 2 scripts loading (plainTextEditor & formEditor) until actual usages of QuickEditor (after first Quick edit click)? It always good, not just for this issue. I think 90%+ admin page load are not used Quick Edit (& contextual link)

Ajax loaded scripts in Drupal missed cache hit. On a slow network, it could be one sec or more delay.

clemens.tolboom’s picture

Version: 8.0.0 » 8.3.x-dev
Skin’s picture

worked for me: after disabling quick edit the warning disappeared an the site become fast again.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

jsulmar’s picture

I observe this warning with Chrome only when a custom block is visible AND QuickEdit is enabled. The warning is not caught by Firefox/Firebug. If it helps, attached is a screen shot from the Chrome console.

Mac_Weber’s picture

Issue summary: View changes

I'm getting this same issue on Chrome and Firefox. In my case Quickedit is not working on both browsers.

droplet’s picture

Status: Active » Postponed

The last patch in the following issue will sort out this problem: #1988968: Drupal.ajax does not guarantee that "add new JS file to page" commands have finished before calling said JS

I have no 100% confidence but it seems the error message is more than just a warning. So my #7 comment was wrong.

pritam.tiwari’s picture

I am also facing the same issue. Getting this error on block configuration overlay form and with custom JS. I have also disabled the quick edit module.

milesgwood’s picture

I also ran into this same issue. None of my css or js files were running with that single console warning appearing. Uninstalling the Quick Edit module solved the problem.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

YuvalBH’s picture

any update with this issue on drupal7.

It seems it is causing submit buttons to be hidden, preventing any editorial flow to work, even setting field groups.
This issue is very critical

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Kris77’s picture

News on how to solve this problem in Drupal 7?

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

agileadam’s picture

FWIW on 8.7.2 this warning goes away if I uninstall the BigPipe module (from core).
Enabling and disabling QuickEdit had no effect.

malcolm_p’s picture

I see the same as @agileadam the warning is from big_pipe regardless of whether quickedit is installed.

This is related to https://xhr.spec.whatwg.org/#the-open()-method

Warning stack trace below:

send	@	jquery.min.js?v=3.2.1:4
ajax	@	jquery.min.js?v=3.2.1:4
r._evalUrl	@	jquery.min.js?v=3.2.1:4
Ja	@	jquery.min.js?v=3.2.1:3
append	@	jquery.min.js?v=3.2.1:3
insert	@	ajax.js?v=8.7.5:538
Drupal.Ajax.success	@	ajax.js?puwfvt:155
bigPipeProcessPlaceholderReplacement	@	big_pipe.js?v=8.7.5:38
each	@	jquery.min.js?v=3.2.1:2
each	@	jquery.min.js?v=3.2.1:2
bigPipeProcessDocument	@	big_pipe.js?v=8.7.5:52
(anonymous)	@	big_pipe.js?v=8.7.5:66
setTimeout (async)		
bigPipeProcess	@	big_pipe.js?v=8.7.5:65
(anonymous)	@	big_pipe.js?v=8.7.5:72
(anonymous)	@	big_pipe.js?v=8.7.5:80
ahimsauzi’s picture

I am on 8.7.5 and disabling QuickEdit took the warning away. BigPipe was never installed.

AltaGrade’s picture

Just as in #25 and #26 the error in our use case was gone after disabling the BigPipe module.

[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/.
send	@	jquery.min.js?v=3.2.1:4
ajax	@	jquery.min.js?v=3.2.1:4
r._evalUrl	@	jquery.min.js?v=3.2.1:4
Ja	@	jquery.min.js?v=3.2.1:3
append	@	jquery.min.js?v=3.2.1:3
insert	@	ajax.js?v=8.7.7:538
Drupal.Ajax.success	@	ajax.js?pyigi4:155
bigPipeProcessPlaceholderReplacement	@	big_pipe.js?v=8.7.7:38
each	@	jquery.min.js?v=3.2.1:2
each	@	jquery.min.js?v=3.2.1:2
bigPipeProcessDocument	@	big_pipe.js?v=8.7.7:52
(anonymous)	@	big_pipe.js?v=8.7.7:78
dispatch	@	jquery.min.js?v=3.2.1:3
q.handle	@	jquery.min.js?v=3.2.1:3
load (async)		
add	@	jquery.min.js?v=3.2.1:3
(anonymous)	@	jquery.min.js?v=3.2.1:3
each	@	jquery.min.js?v=3.2.1:2
each	@	jquery.min.js?v=3.2.1:2
ya	@	jquery.min.js?v=3.2.1:3
on	@	jquery.min.js?v=3.2.1:3
(anonymous)	@	bootstrap.js:539
(anonymous)	@	bootstrap.js:546

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

TomSaw’s picture

Issue tags: -JavaScript +JavaScript

In my case, using Drupal 8.8.1:

Disabling quickedit cleared the warning.
No effect with disabled big_pipe.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

rjdjohnston’s picture

Removing bigpipe isn't a good solution. It significant increases page load times, for me at least. Sad to see Quickedit go, but uninstalling allowed me to edit layouts again :(

RgnYLDZ’s picture

I was doing tests on lighthouse and it gave me two errors on "Best practices" on D9.0.2.

The warning goes away if BigPipe is uninstalled. Quicktabs had no affect at all.

The error on lighthouse (twice) :

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/.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

vistree’s picture

Same problem here! On views pages with facets blocks and BigPipe enabled, I get the same error. Removing the facets blocks OR disabling BigPipe removes the error. But both is not a solution for us ;-)

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

tonytheferg’s picture

seeing this on any pages with nav tabs or quick edit. disabling quick edit seemed to help the pages without nav tabs.

DamienMcKenna’s picture

FTR D7 sites are seeing this with the Views interface, see #3240521: [Deprecation] Synchronous XMLHttpRequest for details.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.