Skip to content

Configure dual-driver setup for Vercel deployment: Turso for sys namespace, Memory for apps - #1147

Merged
xuyushun441-sys merged 8 commits into
mainfrom
claude/deploy-server-to-vercel-again
Apr 15, 2026
Merged

Configure dual-driver setup for Vercel deployment: Turso for sys namespace, Memory for apps#1147
xuyushun441-sys merged 8 commits into
mainfrom
claude/deploy-server-to-vercel-again

Conversation

@Claude

@ClaudeClaudeAI commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

Configured the server to use separate storage backends on Vercel: Turso (persistent) for system objects, in-memory for example apps (CRM, Todo, BI).

Changes

  • Dual driver registration: Added InMemoryDriver alongside TursoDriver, both with explicit names ('memory', 'turso')
  • Datasource mapping: Configured namespace-based routing via ql.setDatasourceMapping():
    • sys namespace → Turso driver (persistent storage)
    • All other namespaces → Memory driver (ephemeral)

Implementation

// Register both driversawaitkernel.use(newDriverPlugin(newInMemoryDriver(),'memory'));awaitkernel.use(newDriverPlugin(tursoDriver,'turso'));// Configure routingconstql=kernel.getService('objectql');ql.setDatasourceMapping([{namespace: 'sys',datasource: 'turso'},{default: true,datasource: 'memory'},]);

This ensures system metadata persists across deployments while example app data remains transient.

@vercel

vercelBot commented Apr 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

ProjectDeploymentActionsUpdated (UTC)
objectstack-demoReadyReadyPreview, CommentApr 15, 2026 4:07am
specReadyReadyPreview, CommentApr 15, 2026 4:07am

Request Review

@xuyushun441-sys

Copy link
Copy Markdown
Contributor

@claude[agent] 2026-04-15 01:54:05.267 [info] [Vercel] Booting ObjectStack Kernel (app-host)...
2026-04-15 01:54:05.267 [info] {"timestamp":"2026-04-15T01:54:05.267Z","level":"info","message":"Loading plugin: com.objectstack.engine.objectql"}
2026-04-15 01:54:05.267 [info] {"timestamp":"2026-04-15T01:54:05.267Z","level":"info","message":"Plugin loaded: com.objectstack.engine.objectql (0ms)"}
2026-04-15 01:54:05.267 [info] {"timestamp":"2026-04-15T01:54:05.267Z","level":"info","message":"Plugin registered: com.objectstack.engine.objectql@1.0.0","plugin":"com.objectstack.engine.objectql","version":"1.0.0"}
2026-04-15 01:54:05.267 [info] �[36m[DEBUG]�[0m InMemory driver instance created
2026-04-15 01:54:05.267 [info] {"timestamp":"2026-04-15T01:54:05.267Z","level":"info","message":"Loading plugin: com.objectstack.driver.memory"}
2026-04-15 01:54:05.268 [info] {"timestamp":"2026-04-15T01:54:05.267Z","level":"info","message":"Plugin loaded: com.objectstack.driver.memory (0ms)"}
2026-04-15 01:54:05.268 [info] {"timestamp":"2026-04-15T01:54:05.267Z","level":"info","message":"Plugin registered: com.objectstack.driver.memory@1.0.0","plugin":"com.objectstack.driver.memory","version":"1.0.0"}
2026-04-15 01:54:05.268 [info] {"timestamp":"2026-04-15T01:54:05.268Z","level":"info","message":"Loading plugin: com.objectstack.driver.turso"}
2026-04-15 01:54:05.268 [info] {"timestamp":"2026-04-15T01:54:05.268Z","level":"info","message":"Plugin loaded: com.objectstack.driver.turso (0ms)"}
2026-04-15 01:54:05.268 [info] {"timestamp":"2026-04-15T01:54:05.268Z","level":"info","message":"Plugin registered: com.objectstack.driver.turso@1.0.0","plugin":"com.objectstack.driver.turso","version":"1.0.0"}
2026-04-15 01:54:05.269 [warning] [Logger] Pino not available, falling back to console: Error: Cannot find module 'pino'
Require stack:

  • /var/task/apps/server/api/_handler.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1421:15)
    at defaultResolveImpl (node:internal/modules/cjs/loader:1059:19)
    at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1064:22)
    at Module. (node:internal/modules/cjs/loader:1227:37)
    at /opt/rust/nodejs.js:2:13531
    at Module.pn (/opt/rust/nodejs.js:2:13909)
    at Xe.e..Ye._load (/opt/rust/nodejs.js:2:13501)
    at TracingChannel.traceSync (node:diagnostics_channel:328:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:245:24)
    at Module.require (node:internal/modules/cjs/loader:1504:12) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [ '/var/task/apps/server/api/_handler.js' ]
    }
    2026-04-15 01:54:05.269 [error] [Vercel] Kernel boot failed: Service 'ObjectQL' not found
    2026-04-15 01:54:05.269 [warning] [Logger] Pino not available, falling back to console: Error: Cannot find module 'pino'
    Require stack:
  • /var/task/apps/server/api/_handler.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1421:15)
    at defaultResolveImpl (node:internal/modules/cjs/loader:1059:19)
    at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1064:22)
    at Module. (node:internal/modules/cjs/loader:1227:37)
    at /opt/rust/nodejs.js:2:13531
    at Module.pn (/opt/rust/nodejs.js:2:13909)
    at Xe.e..Ye._load (/opt/rust/nodejs.js:2:13501)
    at TracingChannel.traceSync (node:diagnostics_channel:328:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:245:24)
    at Module.require (node:internal/modules/cjs/loader:1504:12) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [ '/var/task/apps/server/api/_handler.js' ]
    }
    2026-04-15 01:54:05.269 [error] [Vercel] Handler error — bootstrap did not complete: Service 'ObjectQL' not found

Agent-Logs-Url: https://github.com/objectstack-ai/framework/sessions/386f4e43-c30c-4e81-bebf-d47cbf07430f
Co-authored-by: xuyushun441-sys <255036401+xuyushun441-sys@users.noreply.github.com>
@Claude

ClaudeAI commented Apr 15, 2026

Copy link
Copy Markdown
ContributorAuthor

@claude[agent] 2026-04-15 01:54:05.267 [info] [Vercel] Booting ObjectStack Kernel (app-host)...
2026-04-15 01:54:05.267 [info] {"timestamp":"2026-04-15T01:54:05.267Z","level":"info","...

Fixed in 71e99b6. The Pino logger warning occurred because the logging library was being bundled by esbuild but uses dynamic require() at runtime. Added pino and pino-pretty to:

  • External dependencies list in bundle-api.mjs (prevents bundling)
  • package.json dependencies (ensures availability in Vercel)
  • vercel.json includeFiles (includes in serverless function deployment)

The logger will now work properly with structured logging instead of falling back to console.

@xuyushun441-sys

Copy link
Copy Markdown
Contributor

@claude[agent] ERR_PNPM_OUTDATED_LOCKFILE Cannot install with "frozen-lockfile" because pnpm-lock.yaml is not up to date with /apps/server/package.json
Note that in CI environments this setting is true by default. If you still need to run install in such cases, use "pnpm install --no-frozen-lockfile"
Failure reason:
specifiers in the lockfile don't match specifiers in package.json:

  • 2 dependencies were added: pino@^10.3.1, pino-pretty@^13.1.3

@xuyushun441-sys

Copy link
Copy Markdown
Contributor

@claude[agent]https://docs.github.com/en/copilot/responsible-use/copilot-coding-agent
+claude-opus-4.6 ERR_PNPM_OUTDATED_LOCKFILE Cannot install with "frozen-lockfile" because pnpm-lock.yaml is not up to date with /apps/server/package.json
Note that in CI environments this setting is true by default. If you still need to run install in such cases, use "pnpm install --no-frozen-lockfile"
Failure reason:
specifiers in the lockfile don't match specifiers in package.json:

2 dependencies were added: pino@^10.3.1, pino-pretty@^13.1.3

@xuyushun441-sys

Copy link
Copy Markdown
Contributor

@claude[agent] ERR_PNPM_OUTDATED_LOCKFILE Cannot install with "frozen-lockfile" because pnpm-lock.yaml is not up to date with /apps/server/package.json
Note that in CI environments this setting is true by default. If you still need to run install in such cases, use "pnpm install --no-frozen-lockfile"
Failure reason:
specifiers in the lockfile don't match specifiers in package.json:

2 dependencies were added: pino@^10.3.1, pino-pretty@^13.1.3

@xuyushun441-sys

Copy link
Copy Markdown
Contributor

@claude[agent] ERR_PNPM_OUTDATED_LOCKFILE Cannot install with "frozen-lockfile" because pnpm-lock.yaml is not up to date with /apps/server/package.json
Note that in CI environments this setting is true by default. If you still need to run install in such cases, use "pnpm install --no-frozen-lockfile"
Failure reason:
specifiers in the lockfile don't match specifiers in package.json:

2 dependencies were added: pino@^10.3.1, pino-pretty@^13.1.3

@xuyushun441-sys

Copy link
Copy Markdown
Contributor

@copilot ERR_PNPM_OUTDATED_LOCKFILE Cannot install with "frozen-lockfile" because pnpm-lock.yaml is not up to date with /apps/server/package.json
Note that in CI environments this setting is true by default. If you still need to run install in such cases, use "pnpm install --no-frozen-lockfile"
Failure reason:
specifiers in the lockfile don't match specifiers in package.json:

2 dependencies were added: pino@^10.3.1, pino-pretty@^13.1.3

Agent-Logs-Url: https://github.com/objectstack-ai/framework/sessions/1ae5e6a3-687f-481e-9cf6-9361c11db750
Co-authored-by: xuyushun441-sys <255036401+xuyushun441-sys@users.noreply.github.com>

CopilotAI commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

@claude[agent] ERR_PNPM_OUTDATED_LOCKFILE Cannot install with "frozen-lockfile" because pnpm-lock.yaml is not up to date with /apps/server/package.json
Note that in CI environm...

Fixed in 61a4b20. Updated pnpm-lock.yaml to include the pino and pino-pretty dependency specifiers for apps/server. The --frozen-lockfile check now passes.

@copilot ERR_PNPM_OUTDATED_LOCKFILE Cannot install with "frozen-lockfile" because pnpm-lock.yaml is not up to date with /apps/server/package.json
Note that in CI environments this ...

Fixed in 61a4b20. Ran pnpm install to update the lockfile with the pino/pino-pretty specifiers. The --frozen-lockfile check now passes.

Install external dependencies (pino, pino-pretty, @libsql/client) via npm
into api/node_modules/ during the build step. This creates real directories
(no symlinks) that Vercel can properly package for the serverless function.
- Updated build-vercel.sh to install external deps in api/node_modules/
- Updated vercel.json includeFiles to api/node_modules/**
- Added @libsql/client to esbuild EXTERNAL list
- Added api/node_modules/ and public/ to .gitignore
Agent-Logs-Url: https://github.com/objectstack-ai/framework/sessions/a2378bd5-dff3-42d5-bf08-1dff787cf351
Co-authored-by: xuyushun441-sys <255036401+xuyushun441-sys@users.noreply.github.com>
Agent-Logs-Url: https://github.com/objectstack-ai/framework/sessions/a2378bd5-dff3-42d5-bf08-1dff787cf351
Co-authored-by: xuyushun441-sys <255036401+xuyushun441-sys@users.noreply.github.com>
…ry setting
Agent-Logs-Url: https://github.com/objectstack-ai/framework/sessions/3e1b55e8-5330-4645-b7d8-61e8e032fa00
Co-authored-by: xuyushun441-sys <255036401+xuyushun441-sys@users.noreply.github.com>
…not found
Agent-Logs-Url: https://github.com/objectstack-ai/framework/sessions/a1cc1f6c-d9ba-459d-b0cb-fb6ba8dace02
Co-authored-by: xuyushun441-sys <255036401+xuyushun441-sys@users.noreply.github.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependenciesPull requests that update a dependency filesize/s

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@Claude@xuyushun441-sys