Skip to content

Commit d062a77

Browse files
Claudehotlong
andauthored
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>
1 parent 34bd064 commit d062a77

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

apps/server/server/index.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,23 @@ async function ensureKernel(): Promise<ObjectKernel> {
3333

3434
_bootPromise = (async () => {
3535
console.log('[Vercel] Booting ObjectStack Kernel...');
36+
console.log('[Vercel] Config type:', typeof config);
37+
console.log('[Vercel] Config keys:', Object.keys(config || {}).join(', '));
38+
console.log('[Vercel] Config.plugins type:', typeof config?.plugins);
39+
console.log('[Vercel] Config.plugins length:', Array.isArray(config?.plugins) ? config.plugins.length : 'not an array');
3640

3741
try {
3842
const kernel = new ObjectKernel();
3943

4044
// Register all plugins from shared config
41-
for (const plugin of config.plugins ?? []) {
45+
const plugins = config.plugins || config.default?.plugins;
46+
if (!plugins || !Array.isArray(plugins) || plugins.length === 0) {
47+
throw new Error(`[Vercel] No plugins found in config. Config structure may be incorrect.`);
48+
}
49+
50+
console.log(`[Vercel] Registering ${plugins.length} plugins...`);
51+
for (const plugin of plugins) {
52+
console.log(`[Vercel] Registering plugin: ${plugin?.name || 'unknown'}`);
4253
await kernel.use(plugin as any);
4354
}
4455

0 commit comments

Comments
 (0)