From b4a6fece1ef0ffe9f4bbe8efd8c12406009299f5 Mon Sep 17 00:00:00 2001 From: Raudy Brito Date: Thu, 2 Apr 2026 04:06:06 -0400 Subject: [PATCH 1/3] fix(devtools-vite): prevent console pipe loop and solid-js duplication with Vite 8 --- packages/devtools-vite/src/plugin.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/devtools-vite/src/plugin.ts b/packages/devtools-vite/src/plugin.ts index 22abc2f7..1ab0bc35 100644 --- a/packages/devtools-vite/src/plugin.ts +++ b/packages/devtools-vite/src/plugin.ts @@ -146,7 +146,7 @@ export const devtools = (args?: TanStackDevtoolsViteConfig): Array => { return } - /* const solidDedupeDeps = [ + const solidDedupeDeps = [ 'solid-js', 'solid-js/web', 'solid-js/store', @@ -161,7 +161,7 @@ export const devtools = (args?: TanStackDevtoolsViteConfig): Array => { optimizeDeps: { include: solidDedupeDeps, }, - } */ + } }, }, { @@ -223,6 +223,10 @@ export const devtools = (args?: TanStackDevtoolsViteConfig): Array => { await editor.open(path, lineNum, columnNum) } + const originalConsole = Object.fromEntries( + consolePipingLevels.map((l) => [l, console[l].bind(console)]), + ) as Record + // SSE clients for broadcasting server logs to browser const sseClients: Array<{ res: ServerResponse @@ -248,7 +252,8 @@ export const devtools = (args?: TanStackDevtoolsViteConfig): Array => { onConsolePipe: (entries) => { for (const entry of entries) { const prefix = chalk.cyan('[Client]') - const logMethod = console[entry.level as ConsoleLevel] + const logMethod = + originalConsole[entry.level as ConsoleLevel] const cleanedArgs = stripEnhancedLogPrefix( entry.args, (loc) => chalk.gray(loc), From 764d4defe783443f9334155e1aa9012efe330aaf Mon Sep 17 00:00:00 2001 From: Raudy Brito Date: Thu, 2 Apr 2026 04:07:56 -0400 Subject: [PATCH 2/3] chore: add changeset --- .changeset/twenty-impalas-poke.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/twenty-impalas-poke.md diff --git a/.changeset/twenty-impalas-poke.md b/.changeset/twenty-impalas-poke.md new file mode 100644 index 00000000..9e3ec118 --- /dev/null +++ b/.changeset/twenty-impalas-poke.md @@ -0,0 +1,5 @@ +--- +'@tanstack/devtools-vite': patch +--- + +Fix console pipe feedback loop and solid-js duplication with Vite 8 From cf40ac86699cfd5d2b7542b5329149d285df2953 Mon Sep 17 00:00:00 2001 From: Raudy Brito Date: Thu, 2 Apr 2026 04:21:28 -0400 Subject: [PATCH 3/3] fix(devtools-vite): add defensive fallback for invalid console level --- packages/devtools-vite/src/plugin.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/devtools-vite/src/plugin.ts b/packages/devtools-vite/src/plugin.ts index 1ab0bc35..a8853dbb 100644 --- a/packages/devtools-vite/src/plugin.ts +++ b/packages/devtools-vite/src/plugin.ts @@ -253,7 +253,8 @@ export const devtools = (args?: TanStackDevtoolsViteConfig): Array => { for (const entry of entries) { const prefix = chalk.cyan('[Client]') const logMethod = - originalConsole[entry.level as ConsoleLevel] + originalConsole[entry.level as ConsoleLevel] || + originalConsole.log const cleanedArgs = stripEnhancedLogPrefix( entry.args, (loc) => chalk.gray(loc),