googleapis/mcp-toolbox · info

Failed to load saved panel width:

Error message

Failed to load saved panel width:

What it means

The toolbox web UI's resize.js tries to restore the saved sidebar width from localStorage. Reading localStorage can throw (private browsing, storage disabled, security settings), so the failure is caught and only logged as a console warning; the UI falls back to the default width. It is non-fatal.

Source

Thrown at internal/server/static/js/resize.js:47

    // Create resize handle
    const resizeHandle = document.createElement('div');
    resizeHandle.className = 'resize-handle';
    resizeHandle.setAttribute('aria-label', 'Resize panel');
    secondNav.appendChild(resizeHandle);

    // Load saved width or use default
    let initialWidth = DEFAULT_WIDTH;
    try {
        const savedWidth = localStorage.getItem(STORAGE_KEY);
        if (savedWidth) {
            const parsed = parseInt(savedWidth, 10);
            if (!isNaN(parsed) && parsed >= MIN_WIDTH) {
                initialWidth = parsed;
            }
        }
    } catch (e) {
        // localStorage may be unavailable in private browsing mode
        console.warn('Failed to load saved panel width:', e);
    }
    setPanelWidth(secondNav, initialWidth);

    // Setup resize functionality
    let startX = 0;
    let startWidth = 0;

    const onMouseMove = (e) => {
        const deltaX = e.clientX - startX;
        const newWidth = startWidth + deltaX;
        const maxWidth = (window.innerWidth * MAX_WIDTH_PERCENT) / 100;

        const clampedWidth = Math.max(MIN_WIDTH, Math.min(newWidth, maxWidth));
        setPanelWidth(secondNav, clampedWidth);
    };

    const onMouseUp = () => {
        document.removeEventListener('mousemove', onMouseMove);

View on GitHub (pinned to 8cc6e09de2)

Solutions

  1. No action needed — the UI uses the default panel width when this warning appears
  2. Enable cookies/site data for the toolbox origin to persist panel width
  3. Exit private/incognito mode if you want the layout saved
  4. Safe-list the origin if an extension is blocking storage
Defensive patterns

Strategy: try-catch

Validate before calling

function storageAvailable() {
  try { localStorage.getItem('__t'); return true; } catch (e) { return false; }
}

Try / catch

let saved = null;
try { saved = localStorage.getItem('toolbox-panel-width'); } catch (e) { /* fall back to default */ }

Prevention

When it happens

Trigger: Opening the toolbox UI in a browser context where localStorage.getItem throws: Safari private browsing (older), cookies/site-data blocked, storage quota disabled, or iframe sandbox without allow-same-origin.

Common situations: Corporate browsers blocking site data; running the UI inside a sandboxed iframe; privacy extensions blocking storage access; storage cleared/quota errors.

Related errors


AI-assisted analysis of googleapis/mcp-toolbox@8cc6e09de2 (2026-09-05). Data as JSON: /api/errors/3b544391c704bcac. Report an issue: GitHub.