Skip to content
This repository has been archived by the owner on Sep 29, 2020. It is now read-only.

Yarn 2: gherkin-testcafe tried to access cucumber-expressions, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound #67

Open
lexaurin opened this issue Jun 10, 2020 · 3 comments

Comments

@lexaurin
Copy link

Running gherkin-testcafe with yarn 2 fails on this error:

.pnp.js:14505
    throw firstError;
    ^

Error: gherkin-testcafe tried to access cucumber-expressions, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.

Required package: cucumber-expressions (via "cucumber-expressions")

seems like dependencies should be fixed to make package able to run with new Yarn.

Steps to reproduce

Enable newer yarn

yarn policies set-version berry # below v1.22
yarn set version berry          # on v1.22+

& run gherkin-testcafe

@lexaurin
Copy link
Author

Workaround, in .yarnrc.yml:

packageExtensions:
  "gherkin-testcafe@*":
    dependencies:
      "cucumber-expressions": "*"

@Lukas-Kullmann
Copy link
Contributor

Thanks for bringing this up, @lexaurin !

I have not worked with Yarn 2 yet. I tried adding cucumber-expressions to the peer dependencies, and it fixed the issue you reported. I got a new but similar issue in testcafe-legacy-api. Did you face that issue, too? Or did I do something wrong there?

@lexaurin
Copy link
Author

Hi @Lukas-Kullmann,

yes, there is similar problem with testcafe-legacy-api but once you apply the same workaround here too it will start working all together.

packageExtensions:
  "gherkin-testcafe@*":
    dependencies:
      "cucumber-expressions": "*"
  "testcafe-legacy-api@*":
    dependencies:
      "read-file-relative": "*"
      "testcafe-hammerhead": "*"

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

No branches or pull requests

2 participants