Open threehams opened 3 months ago
Experienced the same issue, and changing it manually fixes it.
Here's what I did to resolve the issue:
Locate the problematic lines in node_modules/cypress/types/lodash.d.ts. Manually adjust the type parameters for WeakMap to ensure they match across all declarations. This approach worked for me.
I hit this error as well, though changing anything in node_modules
only works locally, as it's overwritten in a prod build.
I pinned Typescript to 5.1 for now, but a fix would be nice.
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