add logging
This commit is contained in:
parent
a71b631cb9
commit
b76b8c4c68
@ -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);
|
||||
}
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -40,14 +40,21 @@ export async function bundleComponent(entryPath: string): Promise<string> {
|
||||
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);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user