-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Duplicate identifiers #6489
Comments
looks like a duplicate of #6475 (no pun intended :)) |
can you provide more details on your setup? |
Setup? What do you want to know, besides what I specified already? :) It's a Node project with angular on the frontend. Angular 1.x, NOT 2, like #6475. But like that issue I'm also using some npm/tsd projects both on server and on client side. And the errors seem to come from It ran/runs fine in Visual Studio, but when I run it with NodeMon (via Grunt task) I get this sh@#load of 'duplicate' errors. I'm NOT using browserify, so to keep things simple for now, I have not deduplicated them. I just want one used with CommonJS and one with AMD. On the client we're still on a completely flat structure, using no ES modules client side (only using Angular's modules). Everything is in one (NTVS) project. I could try to make a more minimal recreation and put it it a public repo. That'll take some time though. I was hoping I could be productive sooner :). |
duplicate declarations means you have two declarations for the same entity :). so you have two references to mocha.d.ts, removing one should stop the errors. If i can look at the project i might have a better answer. |
Okay. Well that's a clear statement. There ARE 2 As explained I already remove
from the I then don't get I would have expected that in my regular .ts script I would have to use something like at the top
to reference both client and server side scripts, instead of client only.. |
@mhegazy can I have two tsconfig files in one project? One for server and one for client? It's unclear to me from the documentation. Because the server should have |
This error is so annoying, why can I not just turn it off? I can effectively no longer use the tsc error messages in my IDE directly, and instead have to rely on my gulp output. |
@bartvanderwal sorry for the delay, just saw this now. With TypeScript 1.8, you should be able to have multiple TSConfig files in your project, and it should split your files into islands. see https://github.com/Microsoft/TypeScript/wiki/What%27s-new-in-TypeScript#improved-support-for-tsconfigjson-in-visual-studio-2015 for more details. |
I'm getting these same errors in a classic ASP.NET 4.6.1 solution that doesn't even USE Typescript when compiling under VS2017!! |
I'm experiencing a lot of
Duplicate identifiers
errors. I see around 80 similar issues, but I don't see a clear and workable solution anywhere. Not on stackoverflow neither.I'm using current Typescript, e.g. tsc v1.7.5. The
exclude
option intsconfig
does not seem to be respected, as I get around a 100Duplicate identifier
issues when compiling. All in thetypings
folders. See below. Before I had similar errors innode_modules
files, but they seem to have disappeared after addingnode_modules
in my tsconfig's exclude. But similarly addingtypings
(andclient/typings
) does NOT fix this issue.I'm currently using - only - this in a few of my own
.ts
. But most don't have any at all. At least NOwhere am I referencing intCan you give advice how to solve this? Or is this a temporary bug to be fixed?
I already switched to Visual Studio Code and manual compiling instead of compile on save in Visual Studio with Node Tools for VS, because NTVS kept stalling the UI for dozens of seconds, killing any programmer flow 😢 . I find this typescript potentially very cool and powerful, but practically currently a bit unworkable 😭.
tsd.json
Sample from error output
The text was updated successfully, but these errors were encountered: