Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cypress net::ERR_EMPTY_RESPONSE 6.8.0

Tags:

cypress

When I load the page it makes a call to my api https://<apiurl>/products. In cypress this request fails with:

GET https://<apiurl>/products net::ERR_EMPTY_RESPONSE

If I copy the cURL request the response comes back fine. I double checked the headers coming back from the api and there's no cors issue. Nothing is stubbed this is the entire test:

describe('Plans page', () => {
  it('should load', () => {
    cy.visit('http://localhost:8001/plans')
    expect(1).to.eq(1)
  })
})
"cypress": "6.8.0",
like image 833
azium Avatar asked Sep 06 '25 03:09

azium


1 Answers

In my case the issue was caused by the corporate proxy. I had to add proxy configuration. (I had exactly same error: net::ERR_EMPTY_RESPONSE)

Linux:

export http_proxy=http://...
export https_proxy=http://...
export NO_PROXY=...

cypress open
like image 100
Felix Avatar answered Sep 08 '25 00:09

Felix