-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[NPM] Error: Requiring @playwright/test second time - when using 2 separate npm packages #31478
Comments
Make sure you are using the same version of Playwright in your packages. Npm will perform all the necessary deduplication. You can find the source of the problem via examining package-lock. Most likely you pinned different playwright versions in your package.json deps. |
Looking at the package-lock.json should usually give a clue on if multiple It also depends on how you distribute your util package etc. (esbuild or pure TypeScript etc.) |
I used TSUP to build package. |
Would it be possible to share a reproduction? Otherwise we are not able to act on it, unfortunately. Thank you! |
I have two separate npm packages which are on internal organization npm feed.
Lets call them
all packages using @playwright/test, packageA is "main" one and packageB is using packageA. When i later install packageB to my testingProject i cannot run tests due to
Error: Requiring @playwright/test second time
How to create just one instance of playwright/test, i have playwright.config.ts only in my testing project.
I was trying to use only playwright-core in packages but it wont work in my case as i using expect in them which is not included in core.
Maybe i should export @playwright/test from packageA, but then how to setup testing project without it ?
The text was updated successfully, but these errors were encountered: