question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeScript's ecosystem of self-bundled typings does not work with npm

See original GitHub issue

When npm dependencies have same packages of different versions, tsc throws duplicate identifier errors. TypeScript’s ecosystem of packages is weaker than npm, and does not have compatibility with npm. I believe this is a large problem. And this will be a popular problem because npm always install an exact version in resolving dependencies. For example, when depending a@^0.0.2 and a@^0.0.1 as another package’s dependency, its project has a@0.0.1 and a@0.0.2. npm can resolve these different versions, but TypeScript cannot.

TypeScript Version:

1.9.0-dev.20160526

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:20
  • Comments:13 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
niieanicommented, Jul 7, 2016

@mhegazy What I meant is that dependencies or their dependencies might require an older, conflicting version of a given global typing (e.g. node). Will the TypeScript compiler know to distinguish the in their respectable scopes, or will it cause problems, like the OP described?

1reaction
falsandtrucommented, Apr 29, 2019

Another problem arose: #31148

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeScript 2: custom typings for untyped npm module
Typescript 2.0 introduced typeRoots and types for loading declaration files packaged in npm packages. If you have custom typings or single loose ...
Read more >
@kobdev/types - npm
The repository for *high quality* TypeScript type definitions.. Latest version: 0.1.0, ... If you still can't find it, check if it bundles its...
Read more >
Publishing Node modules with TypeScript and ES modules
Its typing system and compiler are able to catch a variety of bugs at compile time before your software has even run, and...
Read more >
Content Types - ESBuild
But such code will not work with real ECMAScript module implementations such as node ... So when esbuild bundles your code, your imports...
Read more >
Typescript Typings: The Complete Guide: @types Compiler ...
How do I use libraries that don't have Type Definitions available? ... With ts-node installed, let's add a npm script task to run...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found