Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/neat-spies-spend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@tanstack/devtools': patch
---

fixed an issue where SourceInspector was not working when the app is served to a subpath
10 changes: 7 additions & 3 deletions packages/devtools/src/components/source-inspector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,15 @@ export const SourceInspector = () => {
e.preventDefault()
e.stopPropagation()

fetch(
`${location.origin}/__tsd/open-source?source=${encodeURIComponent(
// 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,
)}`,
).catch(() => {})
baseUrl,
)
fetch(url).catch(() => {})
})

const currentElementBoxStyles = createMemo(() => {
Expand Down
Loading