Cypress: Ajax Synchronous Request Failing in Chrome

Created on 16 Apr 2019  路  2Comments  路  Source: cypress-io/cypress

Is this a Feature or Bug?

Bug

Current behavior:

I am getting the error

Error: NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load '_url_ ': Synchronous XHR in page dismissal.

when using Chrome 73. If I switch to Electron 59 everything passes fine.

Desired behavior:

To not get this error in Chrome 73.

Steps to reproduce: (app code and test code)

Not exactly sure how to reproduce this issue but i believe it's caused by an update to chrome that disallows synchronous ajax during end-of-page events (like beforeunload and unload). It's not mentioned in any release docs, but according to this stackoverflow response it was mentioned in a tweet somewhere. From experience, it happens when an ajax request is made in a test, and then is shown as aborted in the following test. Sorry if this issue wasn't detailed enough.

Versions

Cypress 3.2.0, Chrome Version 73.0.3683.103, Windows 10

Most helpful comment

I'm Running Electron 78 and facing the same problem . did you find any work around ?

All 2 comments

Never mind. I believe Cypress is actually working correctly and failing on a request that as of chrome v73 should not be happening. The request is made by a 3rd party tool which still appears to be using synchronous xhr requests in the beforeunload/unload events.

I'm Running Electron 78 and facing the same problem . did you find any work around ?

Was this page helpful?
0 / 5 - 0 ratings