Skip to content

Commit 8f9a65e

Browse files
fix(search): exclude Configure from devtools source injection (#841)
react-instantsearch's <Configure> widget forwards all of its JSX props to Algolia's search parameters. The @tanstack/devtools-vite plugin injects `data-tsd-source="file:line:col"` onto every JSX element in dev, and Configure's pass-through meant the attribute ended up in the request body. Algolia responded with: {"message":"Unknown parameter: data-tsd-source","status":400} and InstantSearch silently circuit-broke — typing in the docsearch modal produced no results. Pass `injectSource.ignore.components: ['Configure']` so the devtools plugin leaves <Configure> alone. Dev-only change; prod builds already strip the attribute.
1 parent 6752c0d commit 8f9a65e

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

vite.config.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,20 @@ export default defineConfig({
194194
},
195195
plugins: [
196196
tanstackDom(),
197-
...(isDev ? [tanstackDevtools()] : []),
197+
...(isDev
198+
? [
199+
tanstackDevtools({
200+
// react-instantsearch's <Configure> forwards all JSX props as
201+
// Algolia search parameters. Injecting `data-tsd-source` as a
202+
// JSX attr leaks it into the request and Algolia 400s with
203+
// "Unknown parameter: data-tsd-source" — breaks site search in dev.
204+
injectSource: {
205+
enabled: true,
206+
ignore: { components: ['Configure'] },
207+
},
208+
}),
209+
]
210+
: []),
198211
tanstackStart({
199212
rsc: {
200213
enabled: true,

0 commit comments

Comments
 (0)