JavaScript console.log causes error: “Synchronous XMLHttpRequest on the main thread is deprecated…”

后端 未结 21 1731
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-22 09:26

I have been adding logs to the console to check the status of different variables without using the Firefox debugger.

However, in many places in which I add a

21条回答
  •  名媛妹妹
    2020-11-22 09:54

    @Webgr partial answer actually helped me debug this warning @ console log, shame the other part of that answer brought so many downvotes :(

    Anyway, here is how I found out what was the cause of this warning in my case:

    1. Use Chrome Browser > Hit F12 to bring DevTools
    2. Open the drawer menu (in Chrome 3 vertical dots in the upper right)
    3. Under Console > check Log XMLHttpRequests option
    4. Reload your page that was giving you the error and observe what happens on each ajax request in the console log.

    In my case, another plugin was loading 2 .js libraries after each ajax call, that were absolutely not required nor necessary. Disabling the rogue plugin removed the warning from the log. From that point, you can either try to fix the problem yourself (e.g. limit the loading of the scripts to certain pages or events - this is way too specific for an answer here) or contact 3rd party plugin developer to solve it.

    Hope this helps someone.

提交回复
热议问题