Repository navigation
No import suggestions for transitive dependencies in [v3.7.3] #35560
Description
Activity
this was done on purpose AFAIK: #32517
Reacted by Ryan CavanaughHi Avi Vahl (@AviVahl) thanks for the input.
In my team's particular setup, the annoyance caused by that change far outweighs the performance gains brought by it.
Basically our setup looks like the following:
- We have a common package that shares common code between 8 other packages.
- We moved a bunch of common dependencies in the
commonpackage so that their versions is always the same across the 8 other packages which prevents us from having to do 8 PRs when we need to bump a dependency's version. Maybe we should be using a mono-repo at this point, but we are currently not.
Solutions ideas/suggestions:
- Add an entry in the
compilerOptionsto disable the new optimization behavior at will. - Allow auto importing things from a transitive dependency
Xonly if there is already something imported (manually) fromX. I don't know if makes sense or not, I'm just shooting ideas. - My team should changes its whole setup to retrieve a behavior that was previously working fine.
Reacted by Jeremy Wolfe, Gabriel Sperrer, Altrim Beqiri, Shadab Ansari, Zdenek Farana, Stéphane Roucheray and PaulKujawaRelevant xkcd: https://xkcd.com/1172/
Sorry, I couldn't resist. 🚎
Reacted by Titian Cernicova-Dragomir, Andrii Dieiev, Ryan Cavanaugh, Sascha Homeier, Lars, Zdenek Farana, PaulKujawa and Gavin King- addedWorking as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug
on Jan 22, 2020 RyanCavanaugh commented
on Jan 22, 2020 MemberMore actionsWe have to take some performance and usability trade-offs in auto-import to make it a useful feature that doesn't bog down the entire development experience.
From an npm perspective, a package's dependencies are not part of its external contract, and assuming that a transitive dependency that's here today will be there tomorrow is a fundamentally incorrect assumption. Of course in this case you control the primary dependency and can enforce that constraint, but from a technical perspective, us culling the transitive dependencies here is objectively correct.
Reacted by AnyhowStep, Günter Zöchbauer, Lucas Simões and GabenGar- locked as resolved and limited conversation to collaborators
on Oct 21, 2025
TypeScript Version: 3.7.3
Search Terms: auto-import suggestions transitive dependencies
Description of the issue
Auto-import suggestions for transitive dependencies exported types don't show up anymore.
package.jsonthe suggestions start showing-upCode
Expected behavior:

v3.6.4 (notice
logCrab2is in the suggestions)Actual behavior:

v3.7.3 with package.json (notice
logCrab2isn't in the suggestions):v3.7.3 without package.json (notice

logCrab2is in the suggestions)Playground Link:
Base project example: https://github.com/gdostie/demo-imports-issue
Project's direct dependency: https://github.com/gdostie/demo-imports-issue-dep
Project's transitive dependency (which exports the
logCrab2function): https://github.com/gdostie/demo-imports-issue-dep-depRelated Issues: