Build error "All declarations of 'WeakMap' must have identical type parameters"
See original GitHub issueI’m submitting a … (check one with “x”)
[ x ] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see use [gitter](https://gitter.im/mgechev/angular2-seed) or [stackoverflow](https://stackoverflow.com/questions/tagged/angular2)
Current behavior
After merging the latest seed I’m now getting a compile error on lodash type:
/node_modules/@types/lodash/index.d.ts(19449,15): error TS2428: All declarations of 'WeakMap' must have identical type parameters.
@types/lodash version = 4.14.37
Even if I run yarn and bring @types/lodash to the latest version (4.14.52), I still get the same error!
(FYI, that error does not affect my app building and running, just a nuisance at this point)
Expected behavior no compile errors
Minimal reproduction of the problem with instructions
just do npm start
Please tell us about your environment: OS X 11.6, VSCode 1.9.1, tsc 2.1.6
-
Angular Seed Version:
10c7272 -
Node:
node --version= 7.4.0,npm= 4.0.5
Issue Analytics
- State:
- Created 7 years ago
- Reactions:3
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Lodash All declarations of 'WeakMap' must have identical type ...
I tried using the @types/lodash package and had problems. ... Lodash All declarations of 'WeakMap' must have identical type parameters.
Read more >All declarations of 'WeakMap' must have identical type ...
Just to document this in case anyone has the same issue I was able to fix this by deleting global node_module folder in...
Read more >Microsoft/TypeScript - Gitter
node_modules/@types/lodash/index.d.ts(19508,15): error TS2428: All declarations of 'WeakMap' must have identical type parameters. typings/globals/lodash/index.d ...
Read more >TypeScript errors and how to fix them
The easiest way to fix the error is to make age optional as well: ... error TS2428: All declarations of ' Strategy '...
Read more >Documentation - TypeScript 3.8
Is only 'Foo' a type? Or every declaration in the import? // We just give an error because it's not clear. import type...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@NathanWalker -
I have checked that. I changed the /node_modules/@types/lodash/index.d.ts to reflect the weakmap definition change to comply with TS 2.2
declare global { interface Set<T> { } interface Map<K, V> { } interface WeakSet<T> { } // interface WeakMap<K, V> { interface WeakMap<K extends object, V> { } }
After that, i could build.prod my project.
I found a work around here https://github.com/DefinitelyTyped/DefinitelyTyped/issues/14324#issuecomment-277738061
@NathanWalker I thought that adding skipLibCheck: true to tsconfig.json should fix the problem but turned out that your script is not using tsconfig.json during production build. Looks like a bug to me? @fourctv Just copy build.js.prod.ts to tools/tasks/project and modify line 22 to add
as tsconfig to makeTsProject
let tsProject = makeTsProject({ skipLibCheck: true }, Config.TMP_DIR);then it should work