Skip to content
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

TypeScript 2.7 breaks @types/lodash #696

Closed
RangarajKaushikSundar opened this issue Feb 5, 2018 · 3 comments
Closed

TypeScript 2.7 breaks @types/lodash #696

RangarajKaushikSundar opened this issue Feb 5, 2018 · 3 comments

Comments

@RangarajKaushikSundar
Copy link

Using Typescript Version 2.7.1 seems to break @types/lodash.

node_modules/@types/lodash/index.d.ts:12651:53 - error TS2344: Type 'T' does not satisfy the constraint 'object'.

12651         isWeakSet<T>(value?: any): value is WeakSet<T>;

The solution mentioned online is to switch back to typescript 2.6.2. Please advise.

@aciccarello
Copy link
Collaborator

What version of @types/lodash does this affect?

@leafriend
Copy link

It seems to be problem of @types/lodash or TypeScript 2.7.1.

Works with @types/lodash@4.14.95:

mkdir types-lodash
cd types-lodash
npm init -y
npm i -D typescript@2.7.1 @types/lodash@4.14.95
cp /dev/null index.ts
npx tsc --init
npx tsc

Broken with @types/lodash@4.14.96:

mkdir types-lodash
cd types-lodash
npm init -y
npm i -D typescript@2.7.1 @types/lodash@4.14.96
cp /dev/null index.ts
npx tsc --init
npx tsc

@leafriend
Copy link

leafriend commented Feb 20, 2018

UPDATED

Sorry for making you confused. It may not problem of TypeScript because TyepDoc uses its own typescript installed under node_modules/typedoc/node_modules/typescript/lib.

I tested @types/lodash from 4.14.90 to 4.14.104 (latest) with command in below:

mkdir typedoc-test
cd typedoc-test
npm init -y
npm i -D typescript@2.7.2 typedoc@0.10.0
cp /dev/null index.ts
npx tsc --init

# Change @types/lodash version in next line
npm i -D @types/lodash@4.14.104
npx typedoc --out docs index.ts

Result shows that @types/lodash from 4.14.96 to 4.14.100 breaks typedoc building.


Original Comment

New TypeScript version 2.7.2 is OK now:

mkdir types-lodash
cd types-lodash
npm init -y
npm i -D typescript@2.7.2 @types/lodash@4.14.96
# or use latest `@types/loadash` version 4.14.104
# npm i -D typescript@2.7.2 @types/lodash^4.14.104
cp /dev/null index.ts
npx tsc --init
npx tsc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants