empty mappings in .d.ts.map for export default of a non-identifier expression
Author: dragomirtitianCreated Sep 24, 2026Updated Sep 28, 2026
LabelsBugHelp Wanted
Search Terms
declarationMap empty mappings, tsgo declaration map default export, d.ts.map mappings empty
Version & Regression Information
- This changed between versions 6.0 and 7.0
⏯ Playground Link
Code
const b = 1;
const d = 2;
export default { b, d };Actual behavior
main.d.ts.map:
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["main.ts"],"names":[],"mappings":""}mappings is an empty string, so the map can't resolve any position in main.d.ts back to main.ts.
Expected behavior
Same as [email protected] on the same input:
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["main.ts"],"names":[],"mappings":";;;;AAEA,wBAAwB"}main.d.ts is byte-identical between tsgo and [email protected] — only mappings differs.
Additional information about the issue
Replacing the object-literal default export with a named identifier (const foo = { b, d }; export default foo;) produces correct, non-empty mappings under tsgo. The empty mappings appear specific to the anonymous _default declaration TypeScript synthesizes for a non-identifier default-export expression.
Source: microsoft/TypeScript