lodash icon indicating copy to clipboard operation
lodash copied to clipboard

A type predicate's type must be assignable to its parameter's type. isEmpty(value: T | null | undefined): value is EmptyObjectOf | null | undefined;

Open richa20shah opened this issue 3 years ago • 6 comments

ERROR in node_modules/@types/lodash.debounce/node_modules/@types/lodash/common/lang.d.ts:577:74 - error TS2677: A type predicate's type must be assignable to its parameter's type. Type 'EmptyObjectOf<T> | null | undefined' is not assignable to type 'T | null | undefined'.

getting error like this:

isEmpty<T extends object>(value: T | null | undefined): value is EmptyObjectOf<T> | null | undefined;

richa20shah avatar Aug 17 '22 06:08 richa20shah

I had the same issue on the Jenkins build. It happened yesterday. However, my local works with the same lodash config. "lodash": "^4.17.15", "@types/lodash": "^4.14.149", "typescript": "~3.5.3"

ChiZhangCormac avatar Aug 17 '22 21:08 ChiZhangCormac

Give us the suggestion how to fix.. We have also the same issue.. Not able to deploy our code

image

grmca2010 avatar Aug 18 '22 04:08 grmca2010

@grmca2010 You can use "@types/lodash": "4.14.182", it works for me.

dmitry-pokhmelnov avatar Aug 18 '22 08:08 dmitry-pokhmelnov

No difference / same error message. This has a production release blocked for me as well.

"lodash": "^4.17.21", "@types/lodash": "^4.14.182", (also tried 4.14.183) "typescript": "~3.5.3",

wsb252 avatar Aug 18 '22 13:08 wsb252

just changing the value in package.json was not sufficient. I had to explicitly add "npm install @types/[email protected]" to pin to that version. With that add to my build script, the issue was resolved.

wsb252 avatar Aug 18 '22 14:08 wsb252

just changing the value in package.json was not sufficient. I had to explicitly add "npm install @types/[email protected]" to pin to that version. With that add to my build script, the issue was resolved.

Thanks a lots, added "npm install @types/[email protected]" to Dockerfile before "npm install" fixed issue for me.

Typescript 3.5.3 & lodash 4.14.182 look good

svdang999 avatar Aug 19 '22 15:08 svdang999

I have the same issue with lodash v4.17.21

markb-trustifi avatar Nov 09 '22 12:11 markb-trustifi