Skip to content

Commit cf40ac8

Browse files
committed
fix(devtools-vite): add defensive fallback for invalid console level
1 parent 764d4de commit cf40ac8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/devtools-vite/src/plugin.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,8 @@ export const devtools = (args?: TanStackDevtoolsViteConfig): Array<Plugin> => {
253253
for (const entry of entries) {
254254
const prefix = chalk.cyan('[Client]')
255255
const logMethod =
256-
originalConsole[entry.level as ConsoleLevel]
256+
originalConsole[entry.level as ConsoleLevel] ||
257+
originalConsole.log
257258
const cleanedArgs = stripEnhancedLogPrefix(
258259
entry.args,
259260
(loc) => chalk.gray(loc),

0 commit comments

Comments
 (0)