Closed
Labels
area: packagingIssues related to Angular's creation of npm packagesIssues related to Angular's creation of npm packageseffort3: weekstype: bug/fix
Description
As I am already including:
"node/node.d.ts": {
"commit": "e850b6ac0d59fee86dd7cb6a1be2caf6400bde14"
}In my tsd.json file and angular also includes those, I get lots of error TS2300: Duplicate identifier ... errors.
Is there really no solution for this? If there is a solution, can someone point me to it because I cannot find something that would make it work, besides me not including these typings in my own tsd.json file.
Reacted by advgal
Metadata
Metadata
Assignees
Labels
area: packagingIssues related to Angular's creation of npm packagesIssues related to Angular's creation of npm packageseffort3: weekstype: bug/fix
Activity
rolandjitsu commentedon Dec 10, 2015
Also, I need to include the jasmine typings that I need for some e2e tests that at this point do not import angular2 at all, so because I cannot include my own typings dependency in
tsd.json(because of the duplicate identifier errors) I get errors likeerror TS2304: Cannot find name 'it'. So that is another annoying thing to see in the compilation output.manland commentedon Dec 10, 2015
👍
Same here 😢
Also, i use express and it import node.ts like this :
Any idea on a solution please ?
dsebastien commentedon Dec 10, 2015
See #5459 and #5395.
This is indeed rather annoying atm :(
xstof commentedon Dec 11, 2015
Same issue for electron projects, which each also reference node. When using electron with angular 2, because of angular bringing it's own node.d.ts typings, there's lots of duplicate identifier errors. Excluding the node.d.ts typings from angular 2 causes an error in "angular2/manual_typings/globals-es6.d.ts(14,1)": "node_modules/angular2/typings/node/node.d.ts' not found". I assume this is because there's a reference path in the globals-es6.d.ts file like this:
<reference path="../typings/node/node.d.ts" />. So far this means I don't seem to be able to properly compile electron with angular 2.rolandjitsu commentedon Dec 11, 2015
@xstof it should still compile, but you will of course see all those nasty complaints in the compiler.
xstof commentedon Dec 11, 2015
Thanks @rolandjitsu - much appreciate the answer; hope the issue will be resolved. Will stick with the compile errors now. When I exclude the node typings from angular it's only one error, coming from globals-es6.d.ts. Alternatively, I'm thinking of doing two gulp-driven compile steps (one for angular related code, using angular node typings; andone for my own core functionality with my npm node import).
rolandjitsu commentedon Dec 11, 2015
@xstof I think we just have to be patient until all this typescript business get's more stable. As far as I know there is something in the pipeline, plus there is another development for this typings business called typings, an alternative to TSD which, from what I understand, should fix all these issues.
But I haven't had the chance to give that tool a try, don't really know where to get started with it 😕
demurgos commentedon Dec 13, 2015
Hi,
I tried typings this week and it nicely solves the duplicate definition errors. From what I could see, it downloads definitions as external modules and then compile it at the root of your project as module declarations. During this process, typings are defined only once and do not clutter the global namespace. Unless you explicitly require a typing, it won't bother you which is really neat.
rolandjitsu commentedon Dec 13, 2015
@demurgos would you mind sharing that setup?
demurgos commentedon Dec 13, 2015
@rolandjitsu Sure, I'll just clean up my project, it should be ready tomorrow.
IgorMinar commentedon Dec 15, 2015
sorry folks, this will have to wait until beta.1 - we will fix it for sure though, the fact that we are reexporting typings and forcing our versions onto angular apps is not right
dsebastien commentedon Dec 15, 2015
86%, beta 0 is getting closer! That'll be a nice christmas gift for geeks =)
24 remaining items
Slals commentedon Feb 4, 2016
Any update about this issue?
I still have a problem with
duplicate identifierwhen I importangular2/core...Also, I'm not able to find any quick fix with
typings. Would anyone mind tell me howtypingsfixes the problem?Will result in more
duplicate identifierwhen compile. I compile withgrunt tsalexeagle commentedon Feb 4, 2016
Typings cannot fix the problem, it contributes additional types, it can't
remove any.
The fix is coming, it did not make beta.3 yesterday partly because we need
an rxjs release, but should be in beta.4.
On Thu, Feb 4, 2016 at 6:33 AM Jonathan Serra [email protected]
wrote:
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.