question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cypress not running on networked WSL drive

See original GitHub issue

Current behavior

Running Cypress on windows and trying to load a project via a networked WSL drive causes an EISDIR error on cypress.json and the directory itself.

Error: EISDIR: illegal operation on a directory, watch '//wsl.localhost/Ubuntu/home/[user]/[project]/cypress.json'
    at FSWatcher.<computed> (node:internal/fs/watchers:244:19)
    at Object.watch (node:fs:2237:34)
    at createFsWatchInstance (D:\Users\[user]\Cypress\resources\app\packages\server\node_modules\chokidar\lib\nodefs-handler.js:119:15)
    at setFsWatchListener (D:\Users\[user]\Cypress\resources\app\packages\server\node_modules\chokidar\lib\nodefs-handler.js:166:15)
    at NodeFsHandler._watchWithNodeFs (D:\Users\[user]\Cypress\resources\app\packages\server\node_modules\chokidar\lib\nodefs-handler.js:331:14)
    at NodeFsHandler._handleFile (D:\Users\[user]\Cypress\resources\app\packages\server\node_modules\chokidar\lib\nodefs-handler.js:395:23)
    at NodeFsHandler._addToNodeFs (D:\Users\[user]\Cypress\resources\app\packages\server\node_modules\chokidar\lib\nodefs-handler.js:629:21)
    at D:\Users\[user]\Cypress\resources\app\packages\server\node_modules\chokidar\index.js:445:21
    at Function.all (<anonymous>:null:null)
 {
  errno: -4068,
  syscall: 'watch',
  code: 'EISDIR',
  path: '//wsl.localhost/Ubuntu/home/[user]/[project]/cypress.json',
  filename: '//wsl.localhost/Ubuntu/home/[user]/[project]/cypress.json'
}
Error: EISDIR: illegal operation on a directory, watch '//wsl$/Ubuntu/home/[user]/[project]/cypress.json'
    at FSWatcher.<computed> (node:internal/fs/watchers:244:19)
    at Object.watch (node:fs:2237:34)
    at createFsWatchInstance (D:\Users\[user]\Cypress\resources\app\packages\server\node_modules\chokidar\lib\nodefs-handler.js:119:15)
    at setFsWatchListener (D:\Users\[user]\Cypress\resources\app\packages\server\node_modules\chokidar\lib\nodefs-handler.js:166:15)
    at NodeFsHandler._watchWithNodeFs (D:\Users\[user]\Cypress\resources\app\packages\server\node_modules\chokidar\lib\nodefs-handler.js:331:14)
    at NodeFsHandler._handleFile (D:\Users\[user]\Cypress\resources\app\packages\server\node_modules\chokidar\lib\nodefs-handler.js:395:23)
    at NodeFsHandler._addToNodeFs (D:\Users\[user]\Cypress\resources\app\packages\server\node_modules\chokidar\lib\nodefs-handler.js:629:21)
    at D:\Users\[user]\Cypress\resources\app\packages\server\node_modules\chokidar\index.js:445:21
    at Function.all (<anonymous>:null:null)
 {
  errno: -4068,
  syscall: 'watch',
  code: 'EISDIR',
  path: '//wsl$/Ubuntu/home/[user]/[project]/cypress.json',
  filename: '//wsl$/Ubuntu/home/[user]/[project]/cypress.json'
}

Using a mounted letter drive causes the same issue.

I do not have Xvfb as my company has not loaded it on the image so running Cypress in WSL is not an option as of now. Happy to use workarounds.

Windows 10 2H20 with Ubuntu 20.04 on WSL2.

Desired behavior

Cypress should list the tests and work normally.

Test code to reproduce

Clone test repo into WSL, download Cypress on host Windows machine, extract, run exe from the command line and select the networked project folder.

Cypress Version

9.6.0

Other

Reproduced with Cypress 9.6.1 on Windows 11 Dev, using WSL2 Ubuntu 18.04.2 LTS.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
MichaelPotecommented, Nov 1, 2022

This is still an issue, @jarrodpan it would be good if you could get that pull request going again?

0reactions
nagash77commented, Aug 31, 2022

Unfortunately we have to close this issue due to inactivity. Please comment if there is new information to provide concerning the original issue and we can reopen.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Running Cypress on WSL - Stack Overflow
I found that the issue was WSL2 needs the display to be set to the IP address of the host Windows machine. This...
Read more >
Troubleshooting | Cypress Documentation
If you're having an issue during installation of Cypress, try removing the contents of the Cypress cache. This will clear out all installed...
Read more >
Using Graphical User Interfaces like Cypress' in WSL2
Running Cypress for the first time on WSL, that's amazing! What I've noticed is that it opens cypress but doesn't run the tests....
Read more >
How to run Cypress on WSL2 - Shouvojit Sarker - Medium
To test it out, go to a repository with Cypress tests and run cypress open . Voila, enjoy testing! Cypress · Wsl 2....
Read more >
Enable and open GUIs apps on Windows Subsystem for Linux ...
Get up and running Cypress, Playwright, QA Wolf and headless Chromium in ... Enable and open GUIs apps on Windows Subsystem for Linux...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found