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

testcafe + peerDependancies #7073

Closed
ben-gooding-sky opened this issue Jun 7, 2022 · 3 comments
Closed

testcafe + peerDependancies #7073

ben-gooding-sky opened this issue Jun 7, 2022 · 3 comments
Labels
TYPE: bug The described behavior is considered as wrong (bug).

Comments

@ben-gooding-sky
Copy link

ben-gooding-sky commented Jun 7, 2022

What is your Scenario?

When using yarn there are peerDependancy errors that are un-fixable for the end-user. Depending on yarn version or config these errors don't always get alerted - but they are still there and anyone strictly trying to clear these dependency warnings/errors can't do so. (for instance, our repo has yarn error YN0002 set to error -> thus blocking getting the latest version.

This issue started when upgrading from 1.18.6 -> 1.19.0 and the errors are:

➤ YN0002: │ testcafe-reporter-dashboard@npm:1.0.0-rc.1 doesn't provide fp-ts (pe5446), requested by io-ts-types
➤ YN0002: │ testcafe-reporter-dashboard@npm:1.0.0-rc.1 doesn't provide fp-ts (pe1a1d), requested by io-ts
➤ YN0002: │ testcafe-reporter-dashboard@npm:1.0.0-rc.1 doesn't provide fp-ts (pf261c), requested by monocle-ts
➤ YN0002: │ testcafe-reporter-dashboard@npm:1.0.0-rc.1 doesn't provide fp-ts (pc987e), requested by newtype-ts

I can't include these dependencies as yarn doesn't care that I have included them and follows its strict semantics that these peerDependancies should be bubbled up in every parent package (or they can just include them directly in the correct package). Notably, if it is included explicitly in the package json it must either be included in the testcafe-reporter-dashboard package.json, or marked as a peerDependancy in there and included in the testcafe package.json.

Either way, every package that includes another package that has a peerDependancy should reference it in some way - for reference https://dev.to/arcanis/implicit-transitive-peer-dependencies-ed0

You can see why this only occurs on version 1.19.0, because if you look at the node_modules on 1.18.6, you can see fp-ts is installed correctly - but when you upgrade it disappears because testcafe-reporter-dashboard removes it as a dependency!

What is the Current behavior?

fp-ts is missing as a required package, but should be included causing a peer dependency error

What is the Expected behavior?

that error no longer occurs (as described in the scenario)

What is your public website URL? (or attach your complete example)

none

What is your TestCafe test code?

{
"private": true,
"name": "testcafe-test",
"version": "1.0.0",
"volta": {
"node": "16.15.1",
"yarn": "1.22.10"
},
"dependencies": {
"testcafe": "1.19.0"
}
}

Your complete configuration file

No response

Your complete test report

No response

Screenshots

No response

Steps to Reproduce

  1. Using yarn 1.22.10 (although this still occurs on many versions - including the latest yarn, Ideally through using volta)
  2. run yarn init
  3. run yarn add testcafe@1.19.0
  4. See warnings for missing peerDependancys for fp-ts

Note:

  1. this method to reproduction only produces a warning - despite this, it is still an error

TestCafe version

1.19.0

Node.js version

16.15.1

Command-line arguments

yarn install

Browser name(s) and version(s)

No response

Platform(s) and version(s)

No response

Other

No response

@ben-gooding-sky ben-gooding-sky added the TYPE: bug The described behavior is considered as wrong (bug). label Jun 7, 2022
@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Jun 7, 2022
@VasilyStrelyaev
Copy link
Collaborator

I have reproduced this behavior. We will update this thread once we have any news.

@need-response-app need-response-app bot removed the STATE: Need response An issue that requires a response or attention from the team. label Jun 13, 2022
@ben-gooding-sky
Copy link
Author

A little update if anyone has this issue - there is workaround with yarn where you can add the dependency manually by putting this in the .yarnrc.yml:

packageExtensions:
  testcafe-reporter-dashboard@*:
    dependencies:
      fp-ts: ^2.0.0

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Jun 15, 2022
@need-response-app need-response-app bot removed the STATE: Need response An issue that requires a response or attention from the team. label Jun 16, 2022
@github-actions
Copy link

Release v1.20.0-alpha.1 addresses this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TYPE: bug The described behavior is considered as wrong (bug).
Projects
None yet
Development

No branches or pull requests

2 participants