fix(devtools-bundler-core): open source files outside cwd and end bad open-source requests (#541)

addSourceToJsx strips cwd from the module path. A file outside cwd (a
monorepo package, or Vite run from another directory) keeps its absolute
path, and the open-source handler then prefixed cwd again. The editor got
paths like /repo/apps/web/repo/packages/pkg/src/panel.tsx.

The handler now uses the absolute path when the cwd-relative file does not
exist and the absolute one does.

A missing or malformed `source` returned without ending the response, so the
request stayed pending until the browser timed out. It now answers 400.

Fixes #281
Fixes #176
Refs #451
This commit is contained in:
Alem Tuzlak 2026-10-29 16:22:49 +01:00 • committed by GitHub
commit df1464cdca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 45 additions and 15 deletions