Closed ghost closed 1 month ago
I run a clean React-Project
npx create-react-app my-app
cd my-app
npm start
Then i've installed and open cypress
npm install cypress --save-dev
node_modules/.bin/cypress open
The same issue
Hey @niawinter, can you open the DevTools console within Cypress to see if there are any errors printed?
Also, if you could list the operating system you are running Cypress on. If you are behind a corporate proxy, we have a fix coming in our next release, but it may require a workaround today: https://github.com/cypress-io/cypress/issues/1469
There are some troubleshooting tips in our docs as well, if you can try any of those or print some more logs in this issue. Otherwise - we can't recreate this.
This issue seemed intermittent to me, until I started plugging in random sites into a cy.visit block.
I have a super simple test case visiting third party sites. Some work, some don't:
Cypress 3.2, Chrome 74, MacOS 10.14.1
describe("testSuite", () => {
it("should visit the site", () => {
cy.visit("https://www.target.com/")
})
})
Works: www.target.com www.cnn.com www.walmart.com
Doesn't work: www.abercrombie.com www.hollisterco.com
CypressError: cy.visit() failed trying to load:
https://www.hollisterco.com/
We attempted to make an http request to this URL but the request failed without a response.
We received this error at the network level:
> Error: read ETIMEDOUT
Common situations why this would fail:
- you don't have internet access
- you forgot to run / boot your web server
- your web server isn't accessible
- you have weird network configuration settings on your computer
The stack trace for this error is:
Error: read ETIMEDOUT
at exports._errnoException (util.js:1024:11)
at TLSWrap.onread (net.js:610:25)
Can you explain why the ones in the list "doesn't work" aren't loading? The more concerning thing is that they're just ignored, i get an ESOCKETTIMEDOUT but nothing more in the logs. I don't even see the network request being made in the network console in chrome developer tools. Could this be a user agent being blocked by a proxy thing?
I'm having the same issue, with the blank screen and the __
in the URL. I'm on MacOS 10.14.3 and Cypress 3.1.0.
regards
I have a MacBook Pro with updated Mojave and Node LTS v10.15.3
I have the same problem and this is the error that the console shows me
Cypress 3.2.0
WebSocket connection to 'ws://localhost:55372/__socket.io/?EIO=3&transport=websocket' failed: WebSocket is closed before the connection is established.
WS.doClose @ cypress_runner.js:175377
Transport.close @ cypress_runner.js:174110
Socket.onClose @ cypress_runner.js:173978
close @ cypress_runner.js:173926
Socket.close @ cypress_runner.js:173921
(anonymous) @ cypress_runner.js:177899
regards
Test with cypress version 3.1.5 and it works perfectly
They should review the version 3.2.0 that is failing
Ok, I got it fixed. I think it was my mistake. I had a global version and a local version. I uninstalled my global and updated the local one to 3.2.0.
Relevant DEBUG log for cy.visit("https://www.abercrombie.com")
cypress:server:socket backend:request {
eventName: 'resolve:url',
args: [
'https://www.abercrombie.com/',
{
auth: null,
failOnStatusCode: true,
retryOnNetworkFailure: true,
retryOnStatusCodeFailure: false,
method: 'GET',
body: null,
headers: {},
timeout: 30000
}
]
} +59ms
cypress:server:server resolving visit {
url: 'https://www.abercrombie.com/',
headers: {
host: 'localhost:59052',
connection: 'Upgrade',
pragma: 'no-cache',
'cache-control': 'no-cache',
'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36',
upgrade: 'websocket',
origin: 'http://localhost:59052',
'sec-websocket-version': '13',
'accept-encoding': 'gzip, deflate, br',
'accept-language': 'en-US,en;q=0.9',
'sec-websocket-key': 'W7KD1d6oJcqGv7Hnz7ArYg==',
'sec-websocket-extensions': 'permessage-deflate;
client_max_window_bits'
},
options: { auth: null, failOnStatusCode: true, retryOnNetworkFailure: true, retryOnStatusCodeFailure: false, method: 'GET', body: null, headers: {}, timeout: 30000 }
} +971ms
cypress:server:server Getting remote state: {
auth: undefined,
props: null,
origin: 'http://localhost:59052',
strategy: 'file',
visiting: undefined,
domainName: 'localhost',
fileServer: 'http://localhost:59053'
} +1ms
cypress:server:server sending request with options {
auth: null, failOnStatusCode: true, retryOnNetworkFailure: true, retryOnStatusCodeFailure: false,
method: 'GET', body: null,
headers: { accept: 'text/html,*/*' }, timeout: 30000, gzip: false,
url: 'https://www.abercrombie.com/',
onBeforeReqInit: [Function: runPhase],
followRedirect: [Function: followRedirect]
} +1ms
cypress:server:cookies getting:cookies { url: 'https://www.abercrombie.com/' } +57ms
...
cypress:server:cookies received get:cookies [] +6ms
cypress:server:request sending request as stream { auth: null, failOnStatusCode: true, retryOnNetworkFailure: true, retryOnStatusCodeFailure: false, method: 'GET', body: null, headers: { accept: 'text/html,*/*', 'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36' }, timeout: 30000, gzip: false, url: 'https://www.abercrombie.com/', onBeforeReqInit: [Function: runPhase] } +0ms
cypress:network:agent addRequest called for https://www.abercrombie.com/ +4s
...
cypress:server:server Getting remote state: { auth: undefined, props: null, origin: 'http://localhost:59052', strategy: 'file', visiting: undefined, domainName: 'localhost', fileServer: 'http://localhost:59053' } +4s
cypress:server:proxy handling proxied request {
url: '/',
proxiedUrl: 'http://hqkjepzjugihiqw/',
headers: {
host: 'hqkjepzjugihiqw',
'proxy-connection': 'keep-alive',
'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36',
'accept-encoding': 'gzip, deflate'
},
remoteState: { auth: undefined, props: null, origin: 'http://localhost:59052', strategy: 'file', visiting: undefined, domainName: 'localhost', fileServer: 'http://localhost:59053' }
} +0ms
cypress:network:agent addRequest called for http://hqkjepzjugihiqw/ +4s
cypress:server:stream_buffer stream buffer writeable final called +0ms
cypress:server:server Getting remote state: { auth: undefined, props: null, origin: 'http://localhost:59052', strategy: 'file', visiting: undefined, domainName: 'localhost', fileServer: 'http://localhost:59053' } +7ms
cypress:server:proxy handling proxied request {
url: '/',
proxiedUrl: 'http://zhosmumfky/',
headers: {
host: 'zhosmumfky',
'proxy-connection': 'keep-alive', 'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36', 'accept-encoding': 'gzip, deflate'
},
remoteState: { auth: undefined, props: null, origin: 'http://localhost:59052', strategy: 'file', visiting: undefined, domainName: 'localhost', fileServer: 'http://localhost:59053' } } +6ms
cypress:network:agent addRequest called for http://zhosmumfky/ +4ms
cypress:server:stream_buffer stream buffer writeable final called +3ms
cypress:server:server Getting remote state: { auth: undefined, props: null, origin: 'http://localhost:59052', strategy: 'file', visiting: undefined, domainName: 'localhost', fileServer: 'http://localhost:59053' } +3ms
cypress:server:proxy handling proxied request {
url: '/',
proxiedUrl: 'http://psfcvnxeb/',
headers: { host: 'psfcvnxeb', 'proxy-connection': 'keep-alive', 'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36', 'accept-encoding': 'gzip, deflate' }, remoteState: { auth: undefined, props: null, origin: 'http://localhost:59052', strategy: 'file', visiting: undefined, domainName: 'localhost', fileServer: 'http://localhost:59053' } } +3ms
cypress:network:agent addRequest called for http://psfcvnxeb/ +4ms
cypress:server:stream_buffer stream buffer writeable final called +5ms
...
cypress:server:request received an error making http request {
auth: null,
failOnStatusCode: true,
retryOnNetworkFailure: true,
retryOnStatusCodeFailure: false,
method: 'GET',
body: null,
headers: {
accept: 'text/html,*/*',
'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36' },
timeout: 30000,
gzip: false,
url: 'https://www.abercrombie.com/',
onBeforeReqInit: [Function: runPhase],
requestId: 'request2',
retryIntervals: [ 0, 1000, 2000, 2000 ],
delaysRemaining: [ 0, 1000, 2000, 2000 ],
err: {
Error: ESOCKETTIMEDOUT
at ClientRequest.<anonymous> (.../Cypress/3.3.1/Cypress.app/Contents/Resources/app/packages/server/node_modules/request/request.js:816:19)
at Object.onceWrapper (events.js:313:30)
at emitNone (events.js:106:13)
at ClientRequest.emit (events.js:208:7)
at TLSSocket.emitTimeout (_http_client.js:708:34)
at Object.onceWrapper (events.js:313:30)
at emitNone (events.js:106:13)
at TLSSocket.emit (events.js:208:7)
at TLSSocket.Socket._onTimeout (net.js:407:8)
at ontimeout (timers.js:475:11)
at tryOnTimeout (timers.js:310:5)
at Timer.listOnTimeout (timers.js:270:5) code: 'ESOCKETTIMEDOUT', connect: false
}
} +31s
Relevant DEBUG log for cy.visit("https://www.hollisterco.com")
cypress:server:socket backend:request {
eventName: 'resolve:url',
args: [
'https://www.hollisterco.com/',
{ auth: null, failOnStatusCode: true, retryOnNetworkFailure: true, retryOnStatusCodeFailure: false, method: 'GET', body: null, headers: {}, timeout: 30000 }
]
} +53ms
cypress:server:server resolving visit {
url: 'https://www.hollisterco.com/',
headers: { host: 'localhost:62427', connection: 'Upgrade', pragma: 'no-cache', 'cache-control': 'no-cache', 'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36', upgrade: 'websocket', origin: 'http://localhost:62427', 'sec-websocket-version': '13', 'accept-encoding': 'gzip, deflate, br', 'accept-language': 'en-US,en;q=0.9', 'sec-websocket-key': '5zYDrofvml+RVBZqOKnktw==', 'sec-websocket-extensions': 'permessage-deflate; client_max_window_bits' }, options: { auth: null, failOnStatusCode: true, retryOnNetworkFailure: true, retryOnStatusCodeFailure: false, method: 'GET', body: null, headers: {}, timeout: 30000 }
} +877ms
cypress:server:server Getting remote state: {
auth: undefined, props: null, origin: 'http://localhost:62427', strategy: 'file', visiting: undefined, domainName: 'localhost', fileServer: 'http://localhost:62428'
} +1ms
cypress:server:server sending request with options {
auth: null, failOnStatusCode: true, retryOnNetworkFailure: true, retryOnStatusCodeFailure: false, method: 'GET', body: null, headers: { accept: 'text/html,*/*' }, timeout: 30000, gzip: false, url: 'https://www.hollisterco.com/', onBeforeReqInit: [Function: runPhase], followRedirect: [Function: followRedirect]
} +1ms
cypress:server:cookies getting:cookies { url: 'https://www.hollisterco.com/' } +52ms
...
cypress:server:cookies received get:cookies [] +10ms
cypress:server:request sending request as stream {
auth: null, failOnStatusCode: true, retryOnNetworkFailure: true, retryOnStatusCodeFailure: false, method: 'GET', body: null, headers: { accept: 'text/html,*/*', 'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36' }, timeout: 30000, gzip: false, url: 'https://www.hollisterco.com/', onBeforeReqInit: [Function: runPhase]
} +0ms
cypress:network:agent addRequest called for https://www.hollisterco.com/ +7s
...
cypress:server:server Getting remote state: { auth: undefined, props: null, origin: 'http://localhost:62427', strategy: 'file', visiting: undefined, domainName: 'localhost', fileServer: 'http://localhost:62428' } +4s
cypress:server:proxy handling proxied request {
url: '/',
proxiedUrl: 'http://tacfxzsbe/',
headers: {
host: 'tacfxzsbe',
'proxy-connection': 'keep-alive',
'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36',
'accept-encoding': 'gzip, deflate'
},
remoteState: { auth: undefined, props: null, origin: 'http://localhost:62427', strategy: 'file', visiting: undefined, domainName: 'localhost', fileServer: 'http://localhost:62428' } } +0ms
cypress:network:agent addRequest called for http://tacfxzsbe/ +1s
cypress:server:stream_buffer stream buffer writeable final called +0ms
cypress:server:server Getting remote state: { auth: undefined, props: null, origin: 'http://localhost:62427', strategy: 'file', visiting: undefined, domainName: 'localhost', fileServer: 'http://localhost:62428' } +4ms
cypress:server:proxy handling proxied request {
url: '/',
proxiedUrl: 'http://bxerptdobcjun/',
headers: {
host: 'bxerptdobcjun',
'proxy-connection': 'keep-alive',
'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36',
'accept-encoding': 'gzip, deflate'
}, remoteState: { auth: undefined, props: null, origin: 'http://localhost:62427', strategy: 'file', visiting: undefined, domainName: 'localhost', fileServer: 'http://localhost:62428' } } +4ms
cypress:network:agent addRequest called for http://bxerptdobcjun/ +2ms
cypress:server:stream_buffer stream buffer writeable final called +2ms
cypress:server:server Getting remote state: { auth: undefined, props: null, origin: 'http://localhost:62427', strategy: 'file', visiting: undefined, domainName: 'localhost', fileServer: 'http://localhost:62428' } +2ms
cypress:server:proxy handling proxied request {
url: '/',
proxiedUrl: 'http://gblxsanavnvvn/',
headers: {
host: 'gblxsanavnvvn',
'proxy-connection': 'keep-alive',
'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36',
'accept-encoding': 'gzip, deflate'
}, remoteState: { auth: undefined, props: null, origin: 'http://localhost:62427', strategy: 'file', visiting: undefined, domainName: 'localhost', fileServer: 'http://localhost:62428' } } +2ms
cypress:network:agent addRequest called for http://gblxsanavnvvn/ +2ms
cypress:server:stream_buffer stream buffer writeable final called +1ms
...
cypress:server:request received an error making http request {
auth: null, failOnStatusCode: true, retryOnNetworkFailure: true, retryOnStatusCodeFailure: false, method: 'GET', body: null, headers: { accept: 'text/html,*/*', 'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36' }, timeout: 30000, gzip: false, url: 'https://www.hollisterco.com/', onBeforeReqInit: [Function: runPhase], requestId: 'request2', retryIntervals: [ 0, 1000, 2000, 2000 ], delaysRemaining: [ 0, 1000, 2000, 2000 ],
err: {
Error: ESOCKETTIMEDOUT
at ClientRequest.<anonymous> (...Cypress/3.3.1/Cypress.app/Contents/Resources/app/packages/server/node_modules/request/request.js:816:19)
at Object.onceWrapper (events.js:313:30)
at emitNone (events.js:106:13)
at ClientRequest.emit (events.js:208:7) a
t TLSSocket.emitTimeout (_http_client.js:708:34)
at Object.onceWrapper (events.js:313:30)
at emitNone (events.js:106:13)
at TLSSocket.emit (events.js:208:7)
at TLSSocket.Socket._onTimeout (net.js:407:8)
at ontimeout (timers.js:475:11)
at tryOnTimeout (timers.js:310:5)
at Timer.listOnTimeout (timers.js:270:5) code: 'ESOCKETTIMEDOUT', connect: false
}
} +31s
@niawinter Can you run cypress with DEBUG logs and paste those here on the instances you are getting a blank page? I can't be sure it is the same issue @bsmithEG is experiencing until we get that.
Greetings, any thoughts on this? I see the label changed to ready for work, do you guys have a brief overview about what the issue is or any thoughts on a work around in the mean time? Thanks!
i think i got rid of this problem by updating to cypress 3.5.0 Edit: nope. false alarm
Greetings, I am using cypress package 5.4.0 version but i find the same behavior. In my case first page that is login page works fine but after putting credentials it doesn't redirect to Home page of application and show blank page as mentioned earlier by many. I found following errors in browser console as well
Same for me it's "Blank (White screen of death)"
Hi Everyone, I'm joining to the 'Blank Page' club. I have something to emphasize: When Cypress open some pages the console shows the following error: TypeError: Cannot read property '0' of undefined
(see the image below)
When I open the same page manually in the browser, the console doesn't show that error.
Note: The URL is irrelevant because this happens with different urls.
A fix for 'hollisterco' site that others might be able to apply using a workaround from @dudziakm
Add to your commands.js
// -- Visit multiple domains in one test
Cypress.Commands.add('forceVisit', url => {
cy.window().then(win => {
return win.open(url, '_self');
});
});
test.spec.js
describe('Hollisterco.com', () => {
it('visits page & accepts cookies', () => {
cy.forceVisit('https://www.hollisterco.com');
cy.get('#site-cookie-banner .secondary-button').first().click();
cy.get('#ccpa-hco-logo').should('exist')
});
});
Screenshot:
is there an official fix for this issue from Cypress. I am using the latest and it's kind of pretty annoying
I have a "solution" in my tests, It seems that the IT steps loose the URL Remove all the IT steps : describe('Registrer Native', () => { // it("Verify1", () => { : a // }) // it("Verify2", () => { : b // }) })
Now I have a structure like (only one IT step): describe('Registrer Native', () => { it('Whole test- Without IT parts', () => { : a : b : c }) })
It is not an optimal solution as I now have a long test , without intermediaries IT tests
Having the same problem, i've even tried with different url but it still showing blankpage and error is there any fix for this?
TypeError: Cannot read properties of undefined (reading 'apply')
Hi, when i use cy.forceVisit() function to visit a second domain url with dynamic session data, for login, it works with early cypress 10 versions and late 10 versions and not with cypress 11 and 12 versions. The error is saying use newwindowopenhelper() instead. I tried but did not work. It works with every version headed, the problem is with headless. My company is worried if we have to update to above cypress 10 , our logins may not work and we may end up replacing cypress with another technology. One reason maybe the url is too long, it works with a short nondynamic url.
@yaseminyarnell3 you can try restoring your localStorage and cookies: https://github.com/cypress-io/cypress/issues/944#issuecomment-788373384.
Hi MuckT, thank you for the reply. Yes, i had restorelocalstorage function on my code as your comment says. But still it does not work, Can you guys check how was cy.forcevisit was implemented for the version from 10.0.0 to 10.5
@yaseminyarnell3 you'll have to add the custom command forceVisit
to your commands.js
// -- Visit multiple domains in one test
Cypress.Commands.add('forceVisit', url => {
cy.window().then(win => {
return win.open(url, '_self');
});
});
Yes, that is exactly what i have. The issue is starting late cypress 10 and all the versions above, when the url of 3RD PARTY single signon url to login, gets long with dynamic session variables, cy.forcevisit() does not work. When a single sign on url is short without dynamic elements i am having no problems.
@yaseminyarnell3 Can you provide a reproducible example so we can look into this?
Can you write me on yaseminyarnell4@gmail.com
We have the same issue since we updated our project to React 18. The issue only occurs on our merge request environment (+ only on specific urls) and not if we run the tests locally. Specific URLs will render a blank screen if called with cy.visit() but the visit command does not fail and tries to go on with the test. As @yaseminyarnell3 said, forceVisit works for us in most cases, but it does not work with dynamic session cookies etc.
@loettz can you provide a reproducible example?
If there's another example of a deployed site that is having this issue, I'd be happy to take a look, but unfortunately I cannot reproduce the error with the information provided.
I am getting this issue just by trying to learn. I installed cloned this repo for learning cypress : https://github.com/filiphric/trelloapp-clean The moment I tried to do the cy.visit with localhost, chrome started to bug out. Now I am unable to use Chrome at all and Firefox is super slow.
I am getting this issue just by trying to learn. I installed cloned this repo for learning cypress : https://github.com/filiphric/trelloapp-clean The moment I tried to do the cy.visit with localhost, chrome started to bug out. Now I am unable to use Chrome at all and Firefox is super slow.
Too add more to it.
I am learning so I could do this.
- This did not fix the issue.
- This seemed to fix the issue so far.
Still not resolved, right?
This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided.
This issue has been closed due to inactivity.
Current behavior:
After installing Cypress doesn't open any URL, even their examples. Run with React.js.
Steps to reproduce: (app code and test code)
Cypress was installed as follows
npm install cypress --save-dev
and open
node_modules/.bin/cypress open
Code from example
Cypress open link http://localhost:50702/__/#/tests/integration/examples/actions.spec.js and nothing happens.
Versions
2.4.1