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

[BUG] yarn playwright test errors with Cannot find module @playwright-test-npm-1.27.1 #18759

Closed
viveleroi opened this issue Nov 12, 2022 · 2 comments
Assignees

Comments

@viveleroi
Copy link

Context:

  • Playwright Version: 1.27.1
  • Operating System: Windows 11
  • Node.js version: 18.9.1
  • Browser: N/A
  • Yarn: 3.2.4

Describe the bug

Installed playwright for the first time using yarn create playwright. Using yarn playwright test errors with:

PS C:\Users\mbotsko\Desktop\v3> yarn playwright test
node:internal/process/esm_loader:97
    internalBinding('errors').triggerUncaughtException(
                              ^

Error [ERR_MODULE_NOT_FOUND]: Cannot find module 'C:\Users\mbotsko\Desktop\v3\.yarn\cache\@playwright-test-npm-1.27.1-ebcb7fdc03-92f219a78c.zip\node_modules\@playwright\test\lib\experimentalLoader.js' imported from C:\Users\mbotsko\Desktop\v3\
Did you mean to import C:/Users/mbotsko/Desktop/v3/.yarn/cache/@playwright-test-npm-1.27.1-ebcb7fdc03-92f219a78c.zip/node_modules/@playwright/test/lib/experimentalLoader.js?
    at new NodeError (node:internal/errors:393:5)
    at finalizeResolution (node:internal/modules/esm/resolve:305:11)
    at moduleResolve (node:internal/modules/esm/resolve:866:10)
    at defaultResolve (node:internal/modules/esm/resolve:1074:11)
    at nextResolve (node:internal/modules/esm/loader:163:28)
    at ESMLoader.resolve (node:internal/modules/esm/loader:838:30)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:425:18)
    at ESMLoader.import (node:internal/modules/esm/loader:522:22)
    at initializeLoader (node:internal/process/esm_loader:75:58)
    at loadESM (node:internal/process/esm_loader:90:11) {
  code: 'ERR_MODULE_NOT_FOUND'
}
@pavelfeldman
Copy link
Member

I can reproduce, yarn create playwright@latest does not work for Yarn 3.2.4.

@mxschmitt
Copy link
Member

Yarn 3 relies on Node.js experimental loaders which Playwright does not support. We recommend NPM 8/9+ which we use to test Playwright.

If there is an easy workaround which can be applied in our codebase to make it work and be covered with a test, we're open to contributions for it.

Closing in the meantime since we can't act on it.

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

No branches or pull requests

3 participants