# shell.nix
{
pkgs ? import <nixpkgs> {},
unstable ? import <unstable> { }
}:
pkgs.mkShell {
# nativeBuildInputs is usually what you want -- tools you need to run
# Check last version of playwright https://search.nixos.org/packages?channel=unstable&from=0&size=50&sort=relevance&type=packages&query=playwright-driver
nativeBuildInputs = with pkgs; [
unstable.playwright-driver.browsers
];
shellHook = ''
export PLAYWRIGHT_BROWSERS_PATH=${unstable.playwright-driver.browsers}
export PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS=true
'';
}
The version of playwright in unstable is 1.40.0. But I need to use the last version of playwright : 1.46.1
I wonder how to use the last version with my shell.nix ?
So you are using devenv.nix and a flake.nix file together? How does that work? It looks like what youāve shared is the flakeā¦ is it possible to share the devenv.nix file too?
We are having some issues using just devenv.nix with our Playwright installation (pnpm dependency). Itās a TypeScript project, but when we run pnpm exec playwright test we are seeing this error:
Error: browserType.launch: Executable doesn't exist at /nix/store/lrrc9yfclwvck9q8ng1b3c7560nlv51a-playwright-browsers/chromium_headless_shell-1148/chrome-linux/headless_shell
That location doesnāt exist, but /nix/store/lrrc9yfclwvck9q8ng1b3c7560nlv51a-playwright-browsers/chromium_headless_shell-1148/chrome-linux/chrome does exist.
Yes, thatās a plain flake.nix file, but it is using the devenv repository. You should be able to use it just by running nix develop --impure. In this setup you donāt have a devenv.nix file.
Iām just not sure why you are getting this error with pnpm, for me using npm works just fine. Are you also using devenv? Could you share the flake file you are using?
We werenāt using a flake at all, was using a devenv.nix file. But Iāve converted it to a flake and get the exact same error as when I use the devenv.nix file.
Iāve tried your flake file and got the same error.
After looking into it, it seems that the path is actually āl/nix/store/x2ih0irl5zby5wgyfrcfjkjfkqfgzg28-playwright-browsers/chromium-1134/chrome-linux/chromeā
Itās in chromium-1134 but for some reason playwright is expecting at chromium-1148.
Looking at that made me realize it was a mismatch between the playwright version requested in my package.json file (v1.49.0) and the related driver version supplied by nixpkgs-unstable (v1.47.0). So updating the package.json file resolved the browserType.launch: Executable doesn't exist error.
Unfortunately, the same tests are still failing. But now itās due to: