add logging

This commit is contained in:
Fredrik Jensen 2025-12-06 17:06:41 +01:00
parent a71b631cb9
commit b76b8c4c68
3 changed files with 13 additions and 5 deletions

View File

@ -20,7 +20,7 @@
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
padding: 1.2px 16px; padding: 0 16px;
background: var(--bg-tertiary); background: var(--bg-tertiary);
border-bottom: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color);
} }

View File

@ -12,6 +12,7 @@
align-items: center; align-items: center;
gap: 8px; gap: 8px;
padding: 8px 16px; padding: 8px 16px;
min-height: 45px;
background: var(--bg-tertiary); background: var(--bg-tertiary);
border-bottom: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color);
font-size: 13px; font-size: 13px;

View File

@ -40,14 +40,21 @@ export async function bundleComponent(entryPath: string): Promise<string> {
result = await runBuild(entryPath); result = await runBuild(entryPath);
console.log('[mcp-ui-kit] First build succeeded'); console.log('[mcp-ui-kit] First build succeeded');
} catch (error) { } 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.) // Handle esbuild service errors in serverless environments (Vercel, Lambda, etc.)
// This happens when the serverless runtime freezes/stops the esbuild subprocess. // This happens when the serverless runtime freezes/stops the esbuild subprocess.
const isServiceError = error instanceof Error && ( const isServiceError = error instanceof Error && (
error.message.includes('service was stopped') || errorMessage.includes('service was stopped') ||
error.message.includes('service is no longer running') || errorMessage.includes('service is no longer running') ||
error.message.includes('The service') errorMessage.includes('The service') ||
errorMessage.includes('could not be found')
); );
console.log('[mcp-ui-kit] Is service error:', isServiceError); console.log('[mcp-ui-kit] Is service error:', isServiceError);