-
Notifications
You must be signed in to change notification settings - Fork 154
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
TL enforces cypress 4.0.1 #121
Comments
Is this related to the fact that I am trying to run this inside the cypress docker container? |
Another obervation: if I don't add the package but run yarn first and then add the TL the install command doesn't throw an error but I still end up with two Cypress versions in /root/.cache/Cypress |
I tried to rollback my TL version but even on 5.0.2 it forces a second install of cypress 4.0.1 |
Thanks for filing this issue! The repository you linked doesn't include this library. Do you have a link to a repo that does? I did run into your exact issue myself, but I don't think it was because of this library. I think it was because of It seems like My workaround was to set a resolutions in the I don't think the issue is with this library, but with how Can you confirm if you're project is using |
I am facing the same issue. The problem does indeed stem from how I'm fairly certain we could fix it with using It's a shame that the types declared in So kinda similar to #98 and unfortunately DefinitelyTyped/DefinitelyTyped#41917 wasn't enough to make It's even more unfortunate given we do not use TypeScript but we get to this dependency maintentance problem because of this library having a dependency on the I however do understand why the package is listed in package.json and do not want it to be removed. An unfortunate dependency management issue indeed 😕 |
@NicholasBoll Sorry. I used the linked repo as a base and only modified the package.json as shown above. Will make that clearer next time. I don't have a direct dependency on I will try your proposed 'resolution solution'. TY |
Ah. I see: https://github.com/testing-library/cypress-testing-library/blob/master/package.json#L46 This library has a dependency on Unfortunately DefinitelyTyped does not allow you to require I'm not sure how to get around that other than this package not requiring the type definitions. Technically the types aren't "required". They would be required only for Typescript projects. Typescript projects would have the same issue as listed here if they are also using Cypress@3.x. I upgraded a project to Cypress@4 without issue. That's another option. If anyone feels strongly that this package should not rely on Otherwise, It does seem funny that technically a major bump to Cypress broke things even without upgrading anything else... |
Yes. Really peculiar that one can install the same package.json two days apart and suddenly it starts breaking because it installs two different versions. Unfortunately, we rely on another library which hasn't been upgraded but until then the |
You think it's worth mentioning this to the guys from DefinitelyTyped? |
Is the issue here that |
Unfortunately the type definitions for this library are on DefinitelyTyped and DefinitelyTyped enforces a restriction on dependencies there. A type definition cannot use The only actionable item from this library would be removing the dependency on the type definitions. There is nothing actionable for the maintainers of The only thing users can do if they hit this issue is to use |
@saschahofmann If you feel strongly that this library should not have a dependency on the type definitions (breaking change), open a PR to suggest removing that dependency. You can open an issue on DefinitelyTyped referencing the Type definitions used to be in this library, but were separated to allow Types and runtime to move independently since the source code here is not in Typescript. |
I actually think the resolution solution is fine especially since I very much like to have the type definitions! I will just wait until the last dependency updates to 4 and this should not even be necessary anymore. Happy to close. |
So to recap, DT won’t allow simply removing the dependency on |
Correct. The |
Yeah, I tried every variant of Another thing to consider is bringing the types back into this repo. I know that I don't have the bandwidth to keep up with things, but @NicholasBoll (or anyone else) if you can commit to maintain them then I'd be ok with that. |
I'd be okay with bringing types back to this repository. I have a branch that was going to update the types on DefinitelyTyped to add a bit more DX to the JSDocs. Perhaps we'll consider bundling that with the next major bump. |
@NicholasBoll do you mean bundling the types? Curious why bundling would be deemed a breaking change to necessitate waiting until the next major. Maybe I'm misunderstanding something 😅 |
I don't know if it will actually break for people, but it could potential break something. There are some other breaking changes we have planned that this could get rolled up into |
We could in theory roll back the changes in a patch release if it ends up being breaking. But I guess the current |
Just as an FYI - we use a Docker image with Cypress already installed in CI, and thus cannot use this library at all because it installs Cypress (due to listing the @types package as a dependency). |
I'm fine if someone wants to bring the typings back and even write the whole thing in typescript. I just don't have the bandwidth to do it myself. |
Have you considering dropping the |
The point is to make it so nobody has to install anything extra to get typings (even regular JavaScript users). |
I understand the intent but it’s causing more problems than it solves. TS users know how to get types. |
I understand your position and I've suggested a solution. I don't have the bandwidth to work on it right now, but I'd welcome anyone to make a PR to internalize the types or even rewrite to TypeScript if they want to. I think that removing the dependency would be a breaking change and I'm not prepared to do that at the moment. |
We have Cypress as an optional dependency to avoid failed downloads crashing our CI so we are not able to use this library due to being forced to download whatever version the |
I've been able to manage this using yarn berry and adding in the packageExtensions:
"@types/testing-library__cypress@*":
dependencies:
"cypress": "4.10.0" # current version installed |
Type Defs are now built-in, so this shouldn't be a problem anymore. |
cypress-testing-library
version: 5.3.0node
version: 2.14.0npm
(oryarn
) version: yarn 1.21.1Relevant code or config
package.json
What you did:
I cloned the cypress gitlab example and added the testing library cypress dependency (as seen in the package.json above) and bumped the cypress version to 3.8.3. I then run cypress in a docker container:
docker run --rm -it -v /<path to repo>/:/<new dir>/ cypress/browsers:node12.14.0-chrome79-ff71 bash
What happened:
While doing
yarn
inside the container I receive an error! Apparently, yarn tries to install two versions of Cypress (3.8.3 and 4.0.1). I remove the TL dependency the error disappears. Not sure whether this expected behaviour or whether the provided peerDependency in TL should handle this?Reproduction repository:
https://gitlab.com/cypress-io/cypress-example-docker-gitlab
The text was updated successfully, but these errors were encountered: