I'm encountering a similar issue to the one described in this post (following lodash error on build 'Cannot find name 'Exclude'')
ERROR in ... /node_modules/@types/lodash/common/object.d.ts (1689,12): Cannot find name 'Exclude'.
ERROR in ... /node_modules/@types/lodash/common/object.d.ts (1766,12): Cannot find name 'Exclude'.
ERROR in ... /node_modules/@types/lodash/common/object.d.ts (1842,34): Cannot find name 'Exclude'.
However, I'm using the lodash-es packages instead of the full lodash packages and the solutions provided aren't working for me.
The relevant dependencies listed in my package.json file are:
"@types/lodash-es": "4.17.0", "lodash-es": "4.17.4", "typescript": "~2.3.2"
It seems like @types/lodash-es was last updated on Mar 04 (check https://www.npmjs.com/package/@types/lodash-es), but I'm not using this latest version, sticking to 4.17.0 specifically.
The suggested solutions point to using a version prior to breaking changes, but my attempts have been unsuccessful.
How can this issue be resolved? The production build is failing because of this...
Update: In examining the project's package-lock.json file, I found this:
"@types/lodash": {
"version": "4.14.123",
"resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.123.tgz"
},
"@types/lodash-es": {
"version": "4.17.0",
"resolved": "https://registry.npmjs.org/@types/lodash-es/-/lodash-es-4.17.0.tgz",
"requires": {
"@types/lodash": "*"
}
},
It appears that when @types/lodash-es requires @types/lodash: *, it brings in the latest version of @types/lodash (4.14.123 - including the breaking change).
How can I ensure a different version of @types/lodash is included when I don't have control over the package-lock.json entries made by my dependency "@types/lodash-es": "4.17.0"?