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

Cannot run tests with @preact/playwright-ct V0.1.1 - "TypeError: (0 , test_1._addRunnerPlugin) is not a function" #12

Open
jernstdoteth opened this issue Apr 12, 2023 · 2 comments

Comments

@jernstdoteth
Copy link

jernstdoteth commented Apr 12, 2023

I have been trying to get V0.1.1 to run with no luck, and I am receiving the following error:

TypeError: (0 , _test._addRunnerPlugin) is not a function
    at Object.<anonymous> (/Users/jacksonernst/playwright-ct/src/index.ts:27:17)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Module.f._compile (/Users/jacksonernst/playwright-ct/node_modules/@playwright/test/lib/utilsBundleImpl.js:16:994)
    at Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Object.i.<computed>.ot._extensions.<computed> (/Users/jacksonernst/playwright-ct/node_modules/@playwright/test/lib/utilsBundleImpl.js:16:1010)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/Users/jacksonernst/playwright-ct/playwright-ct.config.ts:1:1)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Module.f._compile (/Users/jacksonernst/playwright-ct/node_modules/@playwright/test/lib/utilsBundleImpl.js:16:994)
    at Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Object.i.<computed>.ot._extensions.<computed> (/Users/jacksonernst/playwright-ct/node_modules/@playwright/test/lib/utilsBundleImpl.js:16:1010)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at requireOrImport (/Users/jacksonernst/playwright-ct/node_modules/@playwright/test/lib/common/transform.js:163:20)
    at requireOrImportDefaultObject (/Users/jacksonernst/playwright-ct/node_modules/@playwright/test/lib/common/configLoader.js:225:53)
    at ConfigLoader.loadConfigFile (/Users/jacksonernst/playwright-ct/node_modules/@playwright/test/lib/common/configLoader.js:57:26)
    at runTests (/Users/jacksonernst/playwright-ct/node_modules/@playwright/test/lib/cli.js:127:46)
    at ji.<anonymous> (/Users/jacksonernst/playwright-ct/node_modules/@playwright/test/lib/cli.js:45:7)

I've been encountering this error when running my own tests in my project's repo, but the error above was from the tests in this repo. To produce this, I cloned this repo and tried an install with Yarn 1.22.15 (at the V0.1.1 tag). After running the build command, running the test command produced the above error.

Interestingly, installing with pnpm does not result the following error, but I am unable to use pnpm in the project I am working on. Any help would be greatly appreciated!

Edit: Just tried to run the tests in this repo at V0.1.1 after installing with Yarn 3.x and npm, both resulted in the above error. The tests only seem to work when install with pnpm

@jernstdoteth
Copy link
Author

Here is a another reproduction with a basic test setup that matches the readme example:

https://github.com/jernstdoteth/preact-playwright-ct-issue-repro

@jernstdoteth
Copy link
Author

Ok I figured out the issue which fixes the published version:

In package.json, @playwright/test must be included with version 1.30.0 or earlier. The peer dependencies field in the published package.json should be >=1.28.0 and <=1.30.0

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

1 participant