cypress-io / cypress

Fast, easy and reliable testing for anything that runs in a browser.
https://cypress.io
MIT License
47.05k stars 3.19k forks source link

Cypress in Nix failing with "renderer process just crashed" #30601

Open nkalupahana opened 3 days ago

nkalupahana commented 3 days ago

Current behavior

Creating a blank cypress project and trying to run it with the cypress Nix package fails. No specs are run, and it immediately crashes.

Screenshot 2024-11-11 at 11 34 29 AM

Desired behavior

Cypress should run the test successfully. With a non-Nix version of Cypress, it works.

Test code to reproduce

I've created a minimal reproducible example:

docker run -it nixos/nix
git clone https://github.com/nkalupahana/cypress-nix-repro
cd cypress-nix-repro
nix-shell # see default.nix
npm install
npx cypress run --e2e --headless

Cypress Version

13.2.0

Node version

v18.20.4

Operating System

Host OS: macOS 14.6.1 (23G93) In Docker: Linux 5b042f1d30e2 6.10.11-linuxkit #1 SMP Thu Oct 3 10:17:28 UTC 2024 aarch64 GNU/Linux

Debug Logs

https://pastebin.com/p47PGU9

Other

The same issue happens on Cypress 13.13.2, this time with the Electron renderer. In order to see this reproduction, after cloning the repro, switch to the unstable branch.

Screenshot 2024-11-11 at 11 51 44 AM

Setting --browser firefox (with Firefox from Nix) on Nix unstable works. Firefox on Nix main release does not work (hangs trying to open Firefox), but this is a different bug.

cc maintainers of Cypress Nix package: @thorstenweber83 @mmahut @Craftzman7

MikeMcC399 commented 2 days ago

@nkalupahana

According to https://github.com/NixOS/nixpkgs/pull/332513 there are known downstream issues with the NixOS builds for Cypress.

Basically the current version on 13.2.0 is broken as well as it actually builds with a 12.x binary which is even more outdated.

You may find that https://discourse.nixos.org/ can help you with getting Cypress working under NixOS.

This isn't something which can be fixed by Cypress itself.

MikeMcC399 commented 2 days ago

PS If you need a working containerized solution in the meantime, you might consider Cypress Docker images.