From 539bc5c4fee878848129817ad2accd4b90f98e83 Mon Sep 17 00:00:00 2001 From: Tanner Linsley Date: Mon, 20 Apr 2026 20:41:27 -0600 Subject: [PATCH] fix(search): exclude Configure from devtools source injection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit react-instantsearch's 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 alone. Dev-only change; prod builds already strip the attribute. --- vite.config.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/vite.config.ts b/vite.config.ts index 644812963..d4a3743c5 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -194,7 +194,20 @@ export default defineConfig({ }, plugins: [ tanstackDom(), - ...(isDev ? [tanstackDevtools()] : []), + ...(isDev + ? [ + tanstackDevtools({ + // react-instantsearch's forwards all JSX props as + // Algolia search parameters. Injecting `data-tsd-source` as a + // JSX attr leaks it into the request and Algolia 400s with + // "Unknown parameter: data-tsd-source" — breaks site search in dev. + injectSource: { + enabled: true, + ignore: { components: ['Configure'] }, + }, + }), + ] + : []), tanstackStart({ rsc: { enabled: true,