Skip to content

Source maps off when <script> doesn't contain at least one line break #13260

Closed
vitejs/vite-plugin-vue
#585
@AriPerkkio

Description

@AriPerkkio

Vue version

3.5.13

Link to minimal reproduction

https://stackblitz.com/~/edit/vue-source-maps-off?file=index.mjs

Steps to reproduce

pnpm install
node index.mjs
# Check links in ./links.md

What is expected?

Source maps of all fixtures/*.vue files should contain correct mappings. Using the source map visualizer it is visible that files 1-4 contain incorrect mappings.

What is actually happening?

Source maps of first.vue, second.vue, third.vue and fourth.vue are broken. Only the fifth.vue has correct mappings.

System Info

https://stackblitz.com

Any additional comments?

Bonus points if you can show me how to use Vue compiler directly without Vite. A minimal async function compile(sourceCode: string): { code: string, map: SourceMap }. ❤

Metadata

Metadata

Assignees

No one assigned

    Labels

    🔨 p3-minor-bugPriority 3: this fixes a bug, but is an edge case that only affects very specific usage.scope: sfc

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions