-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Description
Current behavior
Hello 👋
We are trying to integrate Cypress but we run into an issue. Cypress tells us that our frontend is not reachable.
The client runs on port 4200 and the server on port 3333.
We are working in an monorepo managed by NX. The client is a basic React application, and the server is a NestJS application.
First we make a call to our server using cy.request
and then we use cy.visit
.
The cy.visit
fails (see screenshot attached) telling is that the connection is refused.
When opening http://localhost:4200
on a browser behaves as intended.
When we change the server URL to point to 127.0.0.1
things work fine (but cookies are broken, and we want cookie 🍪).
I put together a bare bone repository where things can be reproduced: https://github.com/nicolas-marien/nx-cypress-localhost-issue
Please find attached the output of DEBUG=cypress:* NODE_DEBUG=request y nx e2e client-e2e --watch
I do not have any corporate proxy.
Thank you for your help.
Desired behavior
The cy.visit(/)
call should open my client.
Test code to reproduce
Start client and server using yarn nx run-many --target=serve
Run yarn nx e2e client-e2e --watch
and select the only spec file.
Cypress Version
12.3.0
Node version
18.10.0
Operating System
MacOS 12.6.1 (also happens on Ventura)
Debug Logs
[out.txt](https://github.com/cypress-io/cypress/files/10373543/out.txt)
Other
No response