Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jest doesn't work with virtual driver created with subst on Windows #15023

Open
wangito33 opened this issue Apr 9, 2024 · 3 comments
Open

jest doesn't work with virtual driver created with subst on Windows #15023

wangito33 opened this issue Apr 9, 2024 · 3 comments

Comments

@wangito33
Copy link

wangito33 commented Apr 9, 2024

Version

29.7.0

Steps to reproduce

subst x: C:\Users\buildbot\actcache\act\c43893a83296c120

run jest inside X:\hostexecutor\datastore\ui\electron

Got error:

Error: Jest: Failed to parse the TypeScript config file C:\Users\buildbot\actcache\act\c43893a83296c120\hostexecutor\datastore\ui\electron\jest.config.ts
2024-04-09T07:23:29.9462295Z Error: Must use import to load ES Module: C:\Users\buildbot\actcache\act\c43893a83296c120\hostexecutor\datastore\ui\electron\jest.config.ts
2024-04-09T07:23:29.9472459Z require() of ES modules is not supported.
2024-04-09T07:23:29.9473523Z require() of C:\Users\buildbot\actcache\act\c43893a83296c120\hostexecutor\datastore\ui\electron\jest.config.ts from X:\hostexecutor\datastore\ui\electron\node_modules\jest-config\build

If subst is not used and test executed inside C:\Users\buildbot\actcache\act\c43893a83296c120\hostexecutor\datastore\ui\electron, it works fine.

Ideally X: should be used instead of C:\Users\buildbot\actcache\act\c43893a83296c120.

Expected behavior

test works even if virtual driver is used. Since this helps ccache etc.

Actual behavior

Error: Jest: Failed to parse the TypeScript config file C:\Users\buildbot\actcache\act\c43893a83296c120\hostexecutor\datastore\ui\electron\jest.config.ts
2024-04-09T07:23:29.9462295Z Error: Must use import to load ES Module: C:\Users\buildbot\actcache\act\c43893a83296c120\hostexecutor\datastore\ui\electron\jest.config.ts
2024-04-09T07:23:29.9472459Z require() of ES modules is not supported.
2024-04-09T07:23:29.9473523Z require() of C:\Users\buildbot\actcache\act\c43893a83296c120\hostexecutor\datastore\ui\electron\jest.config.ts from X:\hostexecutor\datastore\ui\electron\node_modules\jest-config\build

Additional context

No response

Environment

System:
    OS: Windows 11 10.0.22631
    CPU: (8) x64 AMD Ryzen 9 7950X 16-Core Processor
  Binaries:
    Node: 20.12.0 - C:\Program Files\nodejs\node.EXE
    npm: 10.5.0 - C:\Program Files\nodejs\npm.CMD
  npmPackages:
    jest: ^29.7.0 => 29.7.0
@wangito33
Copy link
Author

See also #8063

@wangito33
Copy link
Author

wangito33 commented Apr 9, 2024

I see that the code linked in #8063 still uses realpath-native which is archived at 2020. Maybe change its use to node native realpath function is enough to fix the issue but this would require node 9.3 and later.

@wangito33
Copy link
Author

Ok. sorry. it seems that realpath-native is already removed in the version that I've used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant