You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Cypress' contains the following line in node_modules/cypress/types/lodash.d.ts, which is created by the cypress package somehow (it is not a normal node_modules dependency, and not part of source):
// Backward compatibility with --target es5declare global {// tslint:disable-next-line:no-empty-interfaceinterfaceSet<T>{}// tslint:disable-next-line:no-empty-interfaceinterfaceMap<K,V>{}// tslint:disable-next-line:no-empty-interfaceinterfaceWeakSet<T>{}// tslint:disable-next-line:no-empty-interfaceinterfaceWeakMap<Kextendsobject,V>{}}
This is based on lodash types 4.14.168, last updated a little over 3 years ago.
When TypeScript 5.2+ is set up with "lib": ["esnext"], the following error occurs when running tsc:
node_modules/cypress/types/lodash/index.d.ts:45:15 - error TS2428: All declarations of 'WeakMap' must have identical type parameters.
45 interface WeakMap<K extends object, V> { }
~~~~~~~
node_modules/typescript/lib/lib.es2015.collection.d.ts:63:11 - error TS2428: All declarations of 'WeakMap' must have identical type parameters.
63 interface WeakMap<K extends WeakKey, V> {
~~~~~~~
node_modules/typescript/lib/lib.es2015.iterable.d.ts:162:11 - error TS2428: All declarations of 'WeakMap' must have identical type parameters.
162 interface WeakMap<K extends WeakKey, V> { }
~~~~~~~
node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:140:11 - error TS2428: All declarations of 'WeakMap' must have identical type parameters.
140 interface WeakMap<K extends WeakKey, V> {
~~~~~~~
Desired behavior
Cypress can exist in a TypeScript project using "lib": ["esnext"] without errors.
Current behavior
Cypress' contains the following line in
node_modules/cypress/types/lodash.d.ts
, which is created by the cypress package somehow (it is not a normal node_modules dependency, and not part of source):This is based on lodash types 4.14.168, last updated a little over 3 years ago.
When TypeScript 5.2+ is set up with
"lib": ["esnext"]
, the following error occurs when runningtsc
:Desired behavior
Cypress can exist in a TypeScript project using
"lib": ["esnext"]
without errors.Test code to reproduce
Minimal repro at https://github.com/threehams/cypress-typescript-5-4
Cypress Version
13.9.0
Node version
20.10.0
Operating System
MacOS 14.4.1
Debug Logs
No response
Other
No response
The text was updated successfully, but these errors were encountered: