GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Server log pipe drops printf-style format substitution, leaks raw `%s` into browser console · Issue #435 · TanStack/devtools

Server log pipe drops printf-style format substitution, leaks raw %s into browser console #435

New issue
Copy link
New issue
Copy link
Open
#479
Open
Server log pipe drops printf-style format substitution, leaks raw %s into browser console#435
#479
Copy link

Description

@ImLunaHey
ImLunaHey
opened on May 12, 2026
Issue body actions

When server-side logs that use printf-style formatting (e.g. Nitro's request logger calling console.log('%s - %s info GET %s %d in %dms', ts, level, method, status, ms)) are piped to the browser via the virtual-console SSE bridge, the format substitution is lost and the literal %s tokens appear in the browser console.

Example output in browser:

[Server] %s - %s info GET /build-version 200 in 1ms

Cause

In packages/devtools-vite/src/virtual-console.ts, the browser-side handler reconstructs the call as:

var prefix = '%c[Server]%c';
logMethod.apply(console, [prefix, prefixStyle, resetStyle].concat(transformedArgs));

The browser console only treats the first argument as a format string. Since the prefix '%c[Server]%c' is now in position 0, the original server-side format string (which is at transformedArgs[0]) is no longer interpreted — its %s tokens print literally and the remaining args are appended as separate values rather than substituted.

Reproduction

Any TanStack Start app with devtools() in the Vite plugins. Hit any route while the dev server is running; the Nitro request log lands in the browser console with literal %s.

Suggested fix

Either:

  • (a) Pre-format the server args with util.format on the server before serializing, so the browser receives a single already-formatted string; or
  • (b) On the browser side, if transformedArgs[0] is a string containing format specifiers, merge it into the prefix format string (e.g. '%c[Server]%c ' + transformedArgs[0]) and shift the remaining args accordingly.

Environment

  • @tanstack/[email protected]
  • Vite 8
  • TanStack Start
  • Node 18+

Activity

  1. github-actions commented on May 12, 2026

    @github-actions
    github-actionsBot
    on May 12, 2026 – with GitHub Actions
    Contributor
    More actions

    Thanks for the detailed report — this is super helpful.\n\nTo match the bug-report requirements and make this easier to verify/fix, could you add:\n1. A minimal reproducible example link (StackBlitz/CodeSandbox/repo) that shows the formatting issue, and\n2. The exact framework/library versions involved (for example TanStack Start version in addition to Vite/devtools versions).\n\nA runnable repro will help us validate behavior and confirm a fix quickly.

  2. github-actions commented on May 12, 2026

    @github-actions
    github-actionsBot
    on May 12, 2026 – with GitHub Actions
    Contributor
    More actions

    Small clarification on my previous comment: the reproduction should show raw %s placeholders appearing literally in the browser console output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.