Declaration soucemap cannot link to correct position at source file

Author: qmhcCreated Jul 31, 2024Updated Aug 29, 2025
Labelsupstream: volar

Vue - Official extension or vue-tsc version

vue-tsc 2.0.29

VSCode version

latest

Vue version

3.4.32

TypeScript version

5.5.3

System Info

bash
System:
  OS: Windows 10 10.0.19045
  CPU: (12) x64 AMD Ryzen 5 3600 6-Core Processor
  Memory: 15.34 GB / 31.95 GB
Binaries:
  Node: 18.16.0 - D:\nodejs\node.EXE
  Yarn: 1.22.19 - D:\yarn\bin\yarn.CMD
  npm: 9.5.1 - D:\nodejs\npm.CMD
Browsers:
  Chrome: 127.0.6533.73
  Edge: Chromium (127.0.2651.74), ChromiumDev (127.0.2610.3)
  Internet Explorer: 11.0.19041.4355

Steps to reproduce

Create some component like the following:

xml
<script setup lang="ts">
defineProps({
  max: {
    type: Number,
    default: 1000
  }
})

const count = defineModel<number>('count', { default: 0 })

const emit = defineEmits(['on-add'])

const inc = () => {
  count.value++
  emit('on-add', count.value)
}
</script>

<template>
  <div
    class="setup"
    @click="inc"
  >
    {{ count }}
  </div>
</template>

Then run vue tsc --declaration --emitDeclarationOnly --declarationMap and check the result.

What is expected?

Click(alt/command) any line in declaration file can jump to the correct position at source file.

What is actually happening?

But not.

Link to minimal reproduction

No response

Any additional comments?

No response