Skip to content
Source
Sign inSign up
TanStack/devtools

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

MergedAlemTuzlakmerged 1 commit intomain fromrefs/pull/541/headmerged by AlemTuzlak View on GitHub

Showing 3 changed files with 45 additions and 15 deletions.

x
0 of 3 viewed, 3 left
7 additions and 0 deletions.changeset/open-source-outside-cwd.mdAdded
View file
@@ -0,0 +1,7 @@
+---
+'@tanstack/devtools-bundler-core': patch
+'@tanstack/devtools-vite': patch
+'@tanstack/devtools-rspack': patch
+---
+​
+Fix "Go to Source" for files outside the current working directory, for example a package in a monorepo or Vite run from another directory. The editor got a path with the working directory added twice. Also answer a missing or malformed `source` with `400` instead of leaving the request pending.
22 additions and 8 deletionspackages/devtools-bundler-core/src/utils.test.tsModified
View file
@@ -1,4 +1,5 @@
import { EventEmitter } from 'node:events'
+import { resolve } from 'node:path'
import { beforeEach, describe, expect, it, test, vi } from 'vitest'
import {
handleDevToolsRequest,
@@ -200,6 +201,7 @@
​
function createMockRes() {
return {
+ statusCode: 200,
setHeader: vi.fn(),
write: vi.fn(),
end: vi.fn(),
@@ -261,20 +263,33 @@
expect(next).not.toHaveBeenCalled()
​
- it('does nothing for __tsd/open-source when source is missing', () => {