Coder Social home page Coder Social logo

Comments (6)

pavelfeldman avatar pavelfeldman commented on August 16, 2024

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.

from playwright.

msieorbus avatar msieorbus commented on August 16, 2024

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.

In my "base" packageA i added in package.json dependencies:
image

so once i install packageA in packageB (packageB have packageA in dependencies) and later install packageB in testing Project it is using those dependencies so versions are for sure the same. I am able to import everything correctly.
However i have still this error when im trying to run my tests...

Error: Requiring @playwright/test second time,

Maybe my playwright.config.ts is in wrong package/place ? It should be only in testing project ?

from playwright.

mxschmitt avatar mxschmitt commented on August 16, 2024

Looking at the package-lock.json should usually give a clue on if multiple @playwright/test versions are installed or not. We need something we can clone and reproduce locally in order to triage this further. Thanks for your understanding!

It also depends on how you distribute your util package etc. (esbuild or pure TypeScript etc.)

from playwright.

msieorbus avatar msieorbus commented on August 16, 2024

I used TSUP to build package.
I added now @playwright/test as a dev dependencies in all 3 projects.
Ive added packageA and package B to my testing project using yarn add -D //relative-pathto-GZ-tarball (before that i used yarn pack ) i checked yarn lock and it seems that its installted only once (as expected as it is in dev dependencies) but still have this issue however...

from playwright.

mxschmitt avatar mxschmitt commented on August 16, 2024

Would it be possible to share a reproduction? Otherwise we are not able to act on it, unfortunately. Thank you!

from playwright.

mxschmitt avatar mxschmitt commented on August 16, 2024

I'll close it in the meantime while we don't have a reproduction. The issue is usually that you have multiple @playwright/test versions in your project. Ideally the utils package should not depend on @playwright/test at all, and only your main project should do. Feel free to re-file with a repro.

from playwright.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.