Repository navigation
'Duplicate identifier' errors after upgrade to 1.0.0 final #5692
Copy link
Copy link
Closed
Description
Bug Report or Feature Request (mark with an x)
- [x] bug report -> please search issues before submitting
- [ ] feature request
Versions.
@angular/cli: 1.0.0
node: 6.9.5
os: darwin x64
@angular/common: 4.0.0
@angular/compiler: 4.0.0
@angular/core: 4.0.0
@angular/forms: 4.0.0
@angular/http: 4.0.0
@angular/platform-browser: 4.0.0
@angular/platform-browser-dynamic: 4.0.0
@angular/router: 4.0.0
@angular/cli: 1.0.0
@angular/compiler-cli: 4.0.0
Repro steps.
Upgrade to angular-cli@1.0.0 / angular@4.0.0 and run ng-serve
The log given by the failure.
I very carefully followed the migration guide to upgrade from RC4 to final. When I run ng serve I'm seeing the following...
ERROR in /Users/[user]/dev/myProject/node_modules/typescript/lib/lib.dom.d.ts (6945,11): Duplicate identifier 'Headers'.
/Users/[user]/dev/myProject/node_modules/typescript/lib/lib.dom.d.ts (6954,13): Duplicate identifier 'Headers'.
/Users/[user]/dev/myProject/node_modules/typescript/lib/lib.dom.d.ts (9343,11): Duplicate identifier 'Request'.
/Users/[user]/dev/myProject/node_modules/typescript/lib/lib.dom.d.ts (9360,13): Duplicate identifier 'Request'.
/Users/[user]/dev/myProject/node_modules/typescript/lib/lib.dom.d.ts (14893,18): Duplicate identifier 'fetch'.
/Users/[user]/dev/myProject/node_modules/typescript/lib/lib.dom.d.ts (14898,6): Duplicate identifier 'BodyInit'.
/Users/[user]/dev/myProject/node_modules/typescript/lib/lib.dom.d.ts (14929,6): Duplicate identifier 'RequestInfo'.
ERROR in /users/[user]/dev/myProject/node_modules/@types/isomorphic-fetch/index.d.ts (23,14): Duplicate identifier 'BodyInit'.
/users/[user]/dev/myProject/node_modules/@types/isomorphic-fetch/index.d.ts (24,14): Duplicate identifier 'RequestInfo'.
/users/[user]/dev/myProject/node_modules/@types/isomorphic-fetch/index.d.ts (28,5): Subsequent variable declarations must have the same type. Variable 'headers' must be of type 'any', but here h
as type 'string[] | Headers | { [index: string]: string; }'.
/users/[user]/dev/myProject/node_modules/@types/isomorphic-fetch/index.d.ts (30,5): Subsequent variable declarations must have the same type. Variable 'mode' must be of type 'string', but here h
as type 'string | RequestMode'.
/users/[user]/dev/myProject/node_modules/@types/isomorphic-fetch/index.d.ts (31,5): Subsequent variable declarations must have the same type. Variable 'credentials' must be of type 'string', but
here has type 'string | RequestCredentials'.
/users/[user]/dev/myProject/node_modules/@types/isomorphic-fetch/index.d.ts (32,5): Subsequent variable declarations must have the same type. Variable 'cache' must be of type 'string', but here
has type 'string | RequestCache'.
/users/[user]/dev/myProject/node_modules/@types/isomorphic-fetch/index.d.ts (41,15): Duplicate identifier 'Headers'.
/users/[user]/dev/myProject/node_modules/@types/isomorphic-fetch/index.d.ts (61,5): All declarations of 'bodyUsed' must have identical modifiers.
/users/[user]/dev/myProject/node_modules/@types/isomorphic-fetch/index.d.ts (81,15): Duplicate identifier 'Request'.
/users/[user]/dev/myProject/node_modules/@types/isomorphic-fetch/index.d.ts (115,13): Duplicate identifier 'fetch'.
ERROR in /Users/[user]/dev/myProject/node_modules/@types/lodash/index.d.ts (19417,15): All declarations of 'WeakMap' must have identical type parameters.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
kunshao-msft commentedon Mar 29, 2017
same error. any update?
uvv001 commentedon Mar 30, 2017
This happens because typescript 2.2.1 include types for "fetch" function. Just remove isomorphic-fetch from package.json.
SebastianSchenk commentedon Mar 30, 2017
I have the same problem after updating to final. After removing @types/isomorphic-fetch the error still occurs.
kuncevic commentedon Apr 11, 2017
Got same issue with
whatwg-fetch.I've got
@types/whatwg-fetchinstalled as well that now I thought causing the problem withTS2.2.2but after I uninstall it just didn't help.Currently I am just commented theimport 'whatwg-fetch';inpolyfils.ts.UPDATE:
Based on this one microsoft/TypeScript#4948 sounds like
Fetch APItypings has already make their way to the latest typescript that is why custom file defs for fetch api are no longer needed.What I've done now is just reinstalled
whatwg-fetchand make sure that I do not have typings defs installed for that. So nowimport 'whatwg-fetch';inpolyfils.tsworking just fine.I think you have to do something similar in case of
isomorphic-fetchfilipesilva commentedon May 3, 2017
Closing as answered by @kuncevic, cheers!
angular-automatic-lock-bot commentedon Sep 7, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.