Skip to content

Source maps in VSCode not working for debug vite.config.ts #19191

@thy486

Description

@thy486

Describe the bug

Debug vite.config.ts failed.

Because temporary file ${workspaceFolder}/vite.config.ts.timestamp-xxx.mjs now is move to ${workspaceFolder}/node_modules/.vite-temp/vite.config.ts.timestamp-xxx.mjs

Relevant

#17894

nodejs/node#45196

Impact

Expect FunctionLocation in debugger: ${workspaceFolder}/vite.config.ts

Actual FunctionLocation in debugger: ${workspaceFolder}/node_modules/.vite-temp/vite.config.ts.timestamp-xxx.mjs

Suggestion

Make temporary filepath for 'vite.config.ts' configurable or add document to explain how to debug

Reproduction

https://stackblitz.com/edit/vitejs-vite-w1tz8u4r?file=index.html&terminal=dev

Steps to reproduce

node --inspect ${workspaceFolder}/node_modules/vite/bin/vite
// or run in javascript debugger terminal
npx vite

System Info

System:
    OS: macOS 15.2
    CPU: (10) arm64 Apple M4
    Memory: 133.61 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.12.0 - ~/.local/state/fnm_multishells/67195_1736746164855/bin/node
    npm: 11.0.0 - ~/.local/state/fnm_multishells/67195_1736746164855/bin/npm
    pnpm: 9.14.2 - ~/.local/state/fnm_multishells/31840_1736503379186/bin/pnpm
    bun: 1.1.42 - ~/.bun/bin/bun
  Browsers:
    Chrome: 131.0.6778.265
    Safari: 18.2
  npmPackages:
    vite: ^6.0.6 => 6.0.7

Used Package Manager

pnpm

Logs

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions