Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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/twenty-impalas-poke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@tanstack/devtools-vite': patch
---

Fix console pipe feedback loop and solid-js duplication with Vite 8
11 changes: 8 additions & 3 deletions packages/devtools-vite/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export const devtools = (args?: TanStackDevtoolsViteConfig): Array<Plugin> => {
return
}

/* const solidDedupeDeps = [
const solidDedupeDeps = [
'solid-js',
'solid-js/web',
'solid-js/store',
Expand All @@ -161,7 +161,7 @@ export const devtools = (args?: TanStackDevtoolsViteConfig): Array<Plugin> => {
optimizeDeps: {
include: solidDedupeDeps,
},
} */
}
},
},
{
Expand Down Expand Up @@ -223,6 +223,10 @@ export const devtools = (args?: TanStackDevtoolsViteConfig): Array<Plugin> => {
await editor.open(path, lineNum, columnNum)
}

const originalConsole = Object.fromEntries(
consolePipingLevels.map((l) => [l, console[l].bind(console)]),
) as Record<ConsoleLevel, typeof console.log>

// SSE clients for broadcasting server logs to browser
const sseClients: Array<{
res: ServerResponse
Expand All @@ -248,7 +252,8 @@ export const devtools = (args?: TanStackDevtoolsViteConfig): Array<Plugin> => {
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),
Expand Down