-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'Cypress could not verify that this server is running' error with baseUrl in component test after updating to v13 #27990
Comments
What is the Which version did you upgrade from? |
Previous version was 12.17.1 My project is an Angular nx monorepo. It is the basic command from nx to execute cypress component tests: project.json "component-test": {
"executor": "@nrwl/cypress:cypress",
"options": {
"cypressConfig": "libs/core/tables/cypress.config.ts",
"testingType": "component",
"skipServe": true,
"devServerTarget": "demo-app:build"
}
} |
But even with the cypress command I have the same output: DevTools listening on ws://127.0.0.1:64440/devtools/browser/9ba17c02-7320-4b6f-abcb-a666f50afe07
We are verifying this server because it has been configured as your baseUrl. Cypress automatically waits until your server is accessible before running tests. We will try connecting to it 3 more times... |
I am also getting this after upgrading to v13. If I replace |
@MetRonnie Could you share your config? Because for me it was not working |
Hmm does not work. |
(I get the "could not verify this server is running" message for both E2E and component tests, when I didn't before. It causes |
Possibly related to #25397? |
I'm seeing a similar issue, @MetRonnie Thanks, updating the
|
I have the same issue after upgrading from Cypress 12.7.2 to 13.6.2. When I run the following command on Linux, I get:
The Interestingly enough, I can run component tests inside a cypress/browsers Docker image ... I don't know what the difference is yet. |
I found a clue! In
Then this issue is now similar to #25397, except here we don't even use a base URL, and nothing I tried so far helps as a workaround. |
@jennifer-shehane : I also reported this issue in #27967. I dont find any other workaround to resolve this issue as well. :( |
After few days of reading the Cypress source code and testing on our Azure server, I found that if ENV-variable HTTP_PROXY or HTTPS_PROXY is set, the server verification would fail. Row 59 in server/lib/util/ensure-url. ts function isListening: export const isListening = (urlStr: string) => {
// takes a urlStr and verifies the hostname + port is listening
let { hostname, protocol, port } = url.parse(urlStr)
if (port == null) {
port = protocol === 'https:' ? '443' : '80'
}
if (process.env.HTTP_PROXY) { <-- HERE
// cannot make arbitrary connections behind a proxy, attempt HTTP/HTTPS
// For some reason, TypeScript gets confused by the "agent" parameter
// and required double ts-ignore to allow it on local machines and on CI
// @ts-ignore
return rp({
url: urlStr,
// @ts-ignore
agent,
proxy: null,
})
.catch({ name: 'StatusCodeError' }, () => {}) // we just care if it can connect, not if it's a valid resource
}
return connect.getAddress(Number(port), String(hostname))
} |
@jennifer-shehane: I think there is a need to verify that the NO_PROXY settings are respected everywhere in the source code |
The issue is reproducible as well with Cypress version: 13.9.0 |
Add this line to your etc/hosts and maybe it will resolve your problem :) 127.0.0.1 localhost |
I have tried this already and unfortunately did not help. |
Current behavior
In the UI it displays the warning "cannot connect base url"
But here it is possible to ignore and execute the tests.
With the CLI it fails:
Desired behavior
Before I updated it to version 13 it was working and it was not required to define the baseUrl for component tests. And the command
npx nx component-test core-tables
works without problemsTest code to reproduce
Cypress Version
13.2.0
Node version
v18.15.0
Operating System
Windows 10
Debug Logs
Other
nx version: 15.7.2
The text was updated successfully, but these errors were encountered: