From fa2c12df3bc65310807dae6d14be0acad78e1b73 Mon Sep 17 00:00:00 2001 From: Lucas Hilgert <77863078+lhilgert9@users.noreply.github.com> Date: Thu, 30 Oct 2025 12:26:43 +0100 Subject: [PATCH 1/4] fix: fix SourceInspector works behind proxy on subpath --- packages/devtools/src/components/source-inspector.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/devtools/src/components/source-inspector.tsx b/packages/devtools/src/components/source-inspector.tsx index 88fb58ea..9791129a 100644 --- a/packages/devtools/src/components/source-inspector.tsx +++ b/packages/devtools/src/components/source-inspector.tsx @@ -78,11 +78,14 @@ export const SourceInspector = () => { e.preventDefault() e.stopPropagation() - fetch( - `${location.origin}/__tsd/open-source?source=${encodeURIComponent( + const baseUrl = new URL(import.meta.env.BASE_URL, location.origin) + const url = new URL( + `__tsd/open-source?source=${encodeURIComponent( highlightState.dataSource, )}`, - ).catch(() => {}) + baseUrl, + ) + fetch(url).catch(() => {}) }) const currentElementBoxStyles = createMemo(() => { From e01c2b638d6f2d8a3d24077ff0614e260597ded5 Mon Sep 17 00:00:00 2001 From: Lucas Hilgert <77863078+lhilgert9@users.noreply.github.com> Date: Thu, 30 Oct 2025 12:44:10 +0100 Subject: [PATCH 2/4] changeset --- .changeset/neat-spies-spend.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/neat-spies-spend.md diff --git a/.changeset/neat-spies-spend.md b/.changeset/neat-spies-spend.md new file mode 100644 index 00000000..0fcc04c3 --- /dev/null +++ b/.changeset/neat-spies-spend.md @@ -0,0 +1,5 @@ +--- +'@tanstack/devtools': minor +--- + +fixed an issue where SourceInspector was not working when the app is served to a subpath From 50cf80d635f706969cd3578f14781e9b6c9585c3 Mon Sep 17 00:00:00 2001 From: Lucas Hilgert <77863078+lhilgert9@users.noreply.github.com> Date: Thu, 30 Oct 2025 12:45:25 +0100 Subject: [PATCH 3/4] fix changeset to patch --- .changeset/neat-spies-spend.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/neat-spies-spend.md b/.changeset/neat-spies-spend.md index 0fcc04c3..f643437e 100644 --- a/.changeset/neat-spies-spend.md +++ b/.changeset/neat-spies-spend.md @@ -1,5 +1,5 @@ --- -'@tanstack/devtools': minor +'@tanstack/devtools': patch --- fixed an issue where SourceInspector was not working when the app is served to a subpath From 932cd46965c1c1acb2078ee5872f506d8f40501a Mon Sep 17 00:00:00 2001 From: Lucas Hilgert <77863078+lhilgert9@users.noreply.github.com> Date: Thu, 30 Oct 2025 13:50:05 +0100 Subject: [PATCH 4/4] ensure changes work in none vite env --- packages/devtools/src/components/source-inspector.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/devtools/src/components/source-inspector.tsx b/packages/devtools/src/components/source-inspector.tsx index 9791129a..b5f51ecb 100644 --- a/packages/devtools/src/components/source-inspector.tsx +++ b/packages/devtools/src/components/source-inspector.tsx @@ -78,7 +78,8 @@ export const SourceInspector = () => { e.preventDefault() e.stopPropagation() - const baseUrl = new URL(import.meta.env.BASE_URL, location.origin) + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + const baseUrl = new URL(import.meta.env?.BASE_URL ?? '/', location.origin) const url = new URL( `__tsd/open-source?source=${encodeURIComponent( highlightState.dataSource,