From b76b8c4c680bb5224aa7732e512d1edbf5afc71d Mon Sep 17 00:00:00 2001 From: Fredrik Jensen Date: Sat, 6 Dec 2025 17:06:41 +0100 Subject: [PATCH] add logging --- packages/inspector/src/components/ResultsPane.css | 2 +- packages/inspector/src/components/ToolsPanel.css | 1 + packages/library/server/bundle.ts | 15 +++++++++++---- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/packages/inspector/src/components/ResultsPane.css b/packages/inspector/src/components/ResultsPane.css index 533be2b..c3eb856 100644 --- a/packages/inspector/src/components/ResultsPane.css +++ b/packages/inspector/src/components/ResultsPane.css @@ -20,7 +20,7 @@ display: flex; align-items: center; justify-content: space-between; - padding: 1.2px 16px; + padding: 0 16px; background: var(--bg-tertiary); border-bottom: 1px solid var(--border-color); } diff --git a/packages/inspector/src/components/ToolsPanel.css b/packages/inspector/src/components/ToolsPanel.css index 3b3e3f7..977b612 100644 --- a/packages/inspector/src/components/ToolsPanel.css +++ b/packages/inspector/src/components/ToolsPanel.css @@ -12,6 +12,7 @@ align-items: center; gap: 8px; padding: 8px 16px; + min-height: 45px; background: var(--bg-tertiary); border-bottom: 1px solid var(--border-color); font-size: 13px; diff --git a/packages/library/server/bundle.ts b/packages/library/server/bundle.ts index 53f6081..78ddd92 100644 --- a/packages/library/server/bundle.ts +++ b/packages/library/server/bundle.ts @@ -40,14 +40,21 @@ export async function bundleComponent(entryPath: string): Promise { result = await runBuild(entryPath); console.log('[mcp-ui-kit] First build succeeded'); } catch (error) { - console.log('[mcp-ui-kit] First build failed:', error instanceof Error ? error.message : error); + const errorMessage = error instanceof Error ? error.message : String(error); + const errorStack = error instanceof Error ? error.stack : ''; + console.log('[mcp-ui-kit] ========== BUILD ERROR =========='); + console.log('[mcp-ui-kit] Error message:', errorMessage); + console.log('[mcp-ui-kit] Error stack:', errorStack); + console.log('[mcp-ui-kit] Full error:', JSON.stringify(error, Object.getOwnPropertyNames(error || {}), 2)); + console.log('[mcp-ui-kit] ================================'); // Handle esbuild service errors in serverless environments (Vercel, Lambda, etc.) // This happens when the serverless runtime freezes/stops the esbuild subprocess. const isServiceError = error instanceof Error && ( - error.message.includes('service was stopped') || - error.message.includes('service is no longer running') || - error.message.includes('The service') + errorMessage.includes('service was stopped') || + errorMessage.includes('service is no longer running') || + errorMessage.includes('The service') || + errorMessage.includes('could not be found') ); console.log('[mcp-ui-kit] Is service error:', isServiceError);