-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Cypress + TypeScript 3.6.2 errors due to outdated JQuery types #5065
Comments
I found that adding |
so I see this is jQuery + testing library issue when finding and triggering elements, which clashes with older jQuery TS definition in Cypress.
|
I don't think testing-library has anything to do with it - I have another project that does not use T-L and it still produces this error when attempting to use TypeScript 3.6.2. I've updated the Additional Information section after learning more about the situation. I'm not sure how to test it since the types tests are run with multiple versions of TS. Using the problematic event property ( |
We are seeing this exact same thing when trying to build our package
|
Same problem for us. Do you know which packages to downgrade to avoid this error ? |
@wandri TypeScript itself - 3.5.3 is fine, 3.6.2 is not. |
Having same issue, ts 3.6.2 |
The code for this is done in cypress-io/cypress#5230, but has yet to be released. |
is there any movement on this release? this bug is ruining our pre-commit script |
Released in |
Current behavior:
In particular:
Desired behavior:
No TypeScript errors.
Steps to reproduce: (app code and test code)
I have a few "real" projects exhibiting this issue, but here's one:
wKovacs64/pwl#88
I can try to craft a more minimal reproduction as time permits.
Versions
Cypress: 3.4.1
TypeScript: 3.6.2
Possible fix:
cypress/cli/package.json
Line 66 in c912e09
Bumping
@types/jquery
from3.3.6
to3.3.31
(the latest version at this time) should resolve the issue (technically,3.3.23
was the first version that worked, but may as well go for the latest?). It worked if I manually replaced the contents of<my_project>/node_modules/cypress/types/jquery
with the@types/jquery@3.3.31
files, although I was not able to getdtslint
to pass in the Cypress project itself due to conflicts somewhere:Looks like the same thing the automated PR (#3343) ran into back in March.
Additional information:
toElement
is an old Internet Explorer property. The DOM types that ship with TypeScript no longer include it inlib.dom.d.ts
. See this comment. I think it was removed in microsoft/TypeScript#32578. The version of@types/jquery
(3.3.6) currently shipped with Cypress still use this property.The
@types/jquery
package went through a restructure in 3.3.21. Prior to that, thetoElement
key in question was present on theJQuery.Event<...>
interface inindex.d.ts
. The new definition ofJQuery.Event
now lives inmisc.d.ts
along with some new related types (TriggeredEvent
,EventBase
, etc.). None of these extend the same list of event types as the old version, and since none of them reference the now-absenttoElement
, the problem is resolved.Since
@types/jquery
3.3.22 does not work but 3.3.23 does, I narrowed down the commits between those version release dates to c6fe757c..bf2beee3 and I'm pretty sure it was fixed in [jquery] Improve declaration of Events API. DefinitelyTyped/DefinitelyTyped#30144.The text was updated successfully, but these errors were encountered: