Skip to content

docs: document attaching the VS Code debugger to a Vite/Fresh dev server#3317

Merged
bartlomieju merged 2 commits into
mainfrom
docs/vscode-debug-vite-fresh
Jun 18, 2026
Merged

docs: document attaching the VS Code debugger to a Vite/Fresh dev server#3317
bartlomieju merged 2 commits into
mainfrom
docs/vscode-debug-vite-fresh

Conversation

@bartlomieju

Copy link
Copy Markdown
Member

Feedback (#2724) reported that there are no instructions for debugging a Deno
Fresh project (which runs Vite) in VS Code. The existing "Using the debugger"
section only covers the generated single-file Deno launch config, which does
not fit a project whose deno task dev starts a long-running Vite server.

This adds a subsection covering the attach workflow: run the dev server under
the Deno inspector (deno run --inspect -A npm:vite, e.g. as a dev:debug
task) and attach VS Code to port 9229.

Verification status:

  • Verified headlessly: I scaffolded a Fresh 2 app (deno task dev is vite)
    and confirmed that running it under --inspect brings up both the Vite dev
    server and a reachable Deno inspector on 9229 (valid target in
    /json/list, Debugger listening on ws://127.0.0.1:9229/...). deno fmt,
    the freshness check, and a local build pass, and the --inspect-wait anchor
    resolves.
  • Needs interactive confirmation before merge: that breakpoints set in
    server-side Fresh route code actually bind and pause through Vite's transform
    in VS Code. I could not verify GUI breakpoint binding headlessly. Marking this
    PR as draft pending that check. If breakpoints don't bind cleanly, we should
    adjust the recipe (e.g. source-map / outFiles settings) or note the
    limitation.

Closes #2724.

@bartlomieju
bartlomieju marked this pull request as ready for review June 18, 2026 16:15
@bartlomieju

Copy link
Copy Markdown
Member Author

Verified interactively in VS Code: breakpoints in a Fresh route handler do bind and pause on the request. The one wrinkle is that a breakpoint in a route that hasn't been loaded yet shows as "Unbound breakpoint" / "Some of your breakpoints could not be set" until Vite loads that module on first request, after which it binds and pauses normally. Added a note documenting that, and marked the PR ready for review.

@bartlomieju
bartlomieju merged commit 84a47e5 into main Jun 18, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feedback: /runtime/reference/vscode/ - Needs Improvement

1 participant