-
-
Notifications
You must be signed in to change notification settings - Fork 42
Open
Description
Reproduction link or steps
Minimal reproduction repo:
Example Repo with problem
This monorepo is based on the template from typescript-monorepo.
This is the tsconfig base: codecompose
Steps to reproduce:
- Clone the reproduction repo
- Run
pnpm installandpnpm build - Open this file
packages/core/src/db-refs.ts - Click "Go to Definition" on a property (e.g mutation_count) of variable
counter. Line: 14 - Observe it navigates to wrong file/location
What is expected?
I expect that the generated maps are correct. And that when i use "Go To Declaration" it takes me to the correct file and line.
What is actually happening?
- The
index.d.mts.maphassourcesContentas an empty array[] - When clicking "Go to Definition" on a type name, it navigates to the correct folder but a random file
- When clicking on a property of that type, it navigates to a completely unrelated file and highlights an unrelated property
Note: This worked correctly in tsdown 0.14.2, but that version had issues with the syntax:
export * as types from './types.ts'The latest version does not have that issue that export syntax but has broken sourcemaps.
Output:
{
"version": 3,
"file": "index.d.mts",
"names": [],
"sources": [
"../src/are-we-there-yet.ts",
"../src/document-types.ts",
"../src/utils/get-error-message.ts",
"../src/utils/invariant.ts",
"../src/utils/is-empty.ts",
"../src/utils/is-present.ts",
"../src/utils/unique.ts"
],
"sourcesContent": [],
"mappings": ";;;;iBACgB,aAAA,CAAA;;;;;;AAAhB;;KCIY,OAAA;;EAAA,UAAO,EAEL,WAAA;;;;;;;;;ADNd;iBEIgB,eAAA;;;iBCLA,SAAA;;;;;;AHChB;iBIGgB,OAAA;;;iBCJA,gBAAgB,4BAA4B;iBAI5C,gBAAgB,qBAAqB;iBAIrC,eAAe,gBAAgB;;;iBCN/B,4CAA4C,IAAC,0CAAA,CAAA,QAAA"
}Any additional comments?
- Empty
sourcesContent: []suggests source files aren't being embedded - The
sourcesarray has correct relative paths - The
mappingsfield exists but appears to map to wrong locations
Is there a version between 0.14.2 and 0.18.4 that:
- Supports
export * as types from './types.ts'syntax - Generates correct sourcemaps with populated
sourcesContent
Or is there a config option to fix the sourcemap generation?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels