From d062a773c7457d62888b428ea488142b44d628b1 Mon Sep 17 00:00:00 2001 From: "anthropic-code-agent[bot]" <242468646+Claude@users.noreply.github.com> Date: Wed, 15 Apr 2026 07:21:02 +0000 Subject: [PATCH 1/2] debug: add diagnostic logging to troubleshoot Vercel config.plugins issue Agent-Logs-Url: https://github.com/objectstack-ai/framework/sessions/3256b101-ac5e-44f2-9293-fab13aa28ec5 Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com> --- apps/server/server/index.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/apps/server/server/index.ts b/apps/server/server/index.ts index 34b939029..de2b8909b 100644 --- a/apps/server/server/index.ts +++ b/apps/server/server/index.ts @@ -33,12 +33,23 @@ async function ensureKernel(): Promise { _bootPromise = (async () => { console.log('[Vercel] Booting ObjectStack Kernel...'); + console.log('[Vercel] Config type:', typeof config); + console.log('[Vercel] Config keys:', Object.keys(config || {}).join(', ')); + console.log('[Vercel] Config.plugins type:', typeof config?.plugins); + console.log('[Vercel] Config.plugins length:', Array.isArray(config?.plugins) ? config.plugins.length : 'not an array'); try { const kernel = new ObjectKernel(); // Register all plugins from shared config - for (const plugin of config.plugins ?? []) { + const plugins = config.plugins || config.default?.plugins; + if (!plugins || !Array.isArray(plugins) || plugins.length === 0) { + throw new Error(`[Vercel] No plugins found in config. Config structure may be incorrect.`); + } + + console.log(`[Vercel] Registering ${plugins.length} plugins...`); + for (const plugin of plugins) { + console.log(`[Vercel] Registering plugin: ${plugin?.name || 'unknown'}`); await kernel.use(plugin as any); } From 34d48274c703151f315add9394be529b0af695cd Mon Sep 17 00:00:00 2001 From: "anthropic-code-agent[bot]" <242468646+Claude@users.noreply.github.com> Date: Wed, 15 Apr 2026 07:50:39 +0000 Subject: [PATCH 2/2] fix: rename config import to stackConfig to avoid shadowing Vercel function config The imported 'config' from objectstack.config.ts was being shadowed by the exported 'config' object (Vercel function configuration) at the end of the file. This caused stackConfig.plugins to be undefined, preventing any plugins from being registered during kernel bootstrap. Fixes the "CRITICAL: Required service missing: data" error on Vercel deployment. Agent-Logs-Url: https://github.com/objectstack-ai/framework/sessions/e4cad7a6-741c-4f4d-9ab8-c69516fa044e Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com> --- apps/server/server/index.ts | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/apps/server/server/index.ts b/apps/server/server/index.ts index de2b8909b..2a1cb2e7a 100644 --- a/apps/server/server/index.ts +++ b/apps/server/server/index.ts @@ -11,7 +11,7 @@ import { ObjectKernel } from '@objectstack/runtime'; import { createHonoApp } from '@objectstack/hono'; import { getRequestListener } from '@hono/node-server'; import type { Hono } from 'hono'; -import config from '../objectstack.config'; +import stackConfig from '../objectstack.config'; // --------------------------------------------------------------------------- // Singleton state — persists across warm Vercel invocations @@ -33,23 +33,16 @@ async function ensureKernel(): Promise { _bootPromise = (async () => { console.log('[Vercel] Booting ObjectStack Kernel...'); - console.log('[Vercel] Config type:', typeof config); - console.log('[Vercel] Config keys:', Object.keys(config || {}).join(', ')); - console.log('[Vercel] Config.plugins type:', typeof config?.plugins); - console.log('[Vercel] Config.plugins length:', Array.isArray(config?.plugins) ? config.plugins.length : 'not an array'); try { const kernel = new ObjectKernel(); // Register all plugins from shared config - const plugins = config.plugins || config.default?.plugins; - if (!plugins || !Array.isArray(plugins) || plugins.length === 0) { - throw new Error(`[Vercel] No plugins found in config. Config structure may be incorrect.`); + if (!stackConfig.plugins || stackConfig.plugins.length === 0) { + throw new Error(`[Vercel] No plugins found in stackConfig`); } - console.log(`[Vercel] Registering ${plugins.length} plugins...`); - for (const plugin of plugins) { - console.log(`[Vercel] Registering plugin: ${plugin?.name || 'unknown'}`); + for (const plugin of stackConfig.plugins) { await kernel.use(plugin as any); }