jest: jest-resolve fails on network drives and RAM-drives on Windows

πŸ’₯ Regression Report

Starting with jest@23 our tests started failing when using a RAM-drive on Windows (we are using a tool called ImDisk). The same can be reproduced when using a network drive (net use).

Last working version

Worked up to version: v22.4.4

Stopped working in version: v23.0.0

To Reproduce

Steps to reproduce the behavior:

  1. Follow the Getting Started guide and create a simple test suite
  2. Create a network drive e.g. net use x: \\localhost\c$\tmp
  3. Open the command line in x: and run yarn test / npm test

Expected behavior

Test suite should pass.

Actual behavior

Resolution fails with different kinds of errors, e.g.:

    Cannot find module 'source-map-support' from 'source-map-support.js'

      at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:221:17)

or

   EISDIR: illegal operation on a directory, realpath '...\node_modules\regenerator-runtime'

     at realpathSync (node_modules/realpath-native/index.js:25:32)

Run npx envinfo --preset jest

Paste the results here:

  System:
    OS: Windows 8.1
    CPU: x64 Intel(R) Core(TM) i5-4200M CPU @ 2.50GHz
  Binaries:
    Yarn: 1.7.0 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 5.6.0 - C:\Program Files\nodejs\npm.CMD

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 21 (12 by maintainers)

Commits related to this issue

Most upvoted comments

I was getting

 Cannot find module 'source-map-support' from 'source-map-support.js'

      at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:221:17)

Changing

"moduleDirectories": ["/node_modules/"],

to

"moduleDirectories": ["node_modules"],

fixed the issue

Yes, sorry, I meant jest-resolve options. We’re already using a custom resolver in our project, so that should work fine.