#463·madge

TypeScript v6: aliased imports skipped when tsconfig has no baseUrl

Author: thehollaCreated Jun 2, 2026Updated Jun 2, 2026

Hey team, I think we've run into a TypeScript v6 compatibility edge case.

For context, we're upgrading from TypeScript v5 to v6. We removed baseUrl from the project tsconfig.json as that field is now deprecated. Also, our codebase uses paths mappings (@/*) and aliased imports.

The issue: After the upgrade (specifically after removing baseUrl from the tsconfig), madge output started massively undercounting dependencies. Most paths had a reported decrease of 98%+. I confirmed in one example route that injecting a runtime baseUrl into the object madge uses for its tsconfig brought us back to the previous dependency counts.

So, this appears to be a compatibility issue specifically for repos on TypeScript 6 that heavily use module aliases.

Happy to provide a minimal example to reproduce if that's helpful.

Possibly related to a few other issues: