Skip to content

Fix Vercel deployment: pin Node 20.x, build all packages, fix TS2742 errors#263

Merged
hotlong merged 2 commits intomainfrom
copilot/fix-vercel-deployment-issues
Feb 13, 2026
Merged

Fix Vercel deployment: pin Node 20.x, build all packages, fix TS2742 errors#263
hotlong merged 2 commits intomainfrom
copilot/fix-vercel-deployment-issues

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 13, 2026

Vercel deploy fails during pnpm installbetter-sqlite3 has no prebuilt binaries for Node 24.13.0 (which Vercel selects given engines.node: ">=20.0.0"), triggering a native compilation that fails. Additionally, build:vercel only built @objectos/web, leaving workspace packages uncompiled for the API serverless function.

Node runtime

  • Pin engines.node to "20.x" (matches existing .node-version), ensuring prebuilt better-sqlite3 binaries are available

Build scope

  • Change build:vercel from --filter=@objectos/web... to --filter='!@objectos/site' — the API function at api/index.ts imports objectstack.config.ts which transitively requires all @objectos/* packages to have dist/ built

TS2742 declaration errors in @objectos/permissions

  • ObjectSchema.create() returns a type referencing internal @objectstack/spec chunk files, causing declaration emit failures
  • Added explicit ServiceObject type annotations on all 7 exported object constants:
import type { ServiceObject } from '@objectstack/spec/data';

export const RoleObject: ServiceObject = ObjectSchema.create({ ... });

Housekeeping

  • Sync pnpm-workspace.yaml onlyBuiltDependencies with package.json (add better-sqlite3)
  • Remove unused ACCESS_LEVELS constant in organization_default.ts

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@vercel
Copy link
Copy Markdown

vercel bot commented Feb 13, 2026

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

Project Deployment Actions Updated (UTC)
objectos Ready Ready Preview, Comment Feb 13, 2026 7:26am
objectos-demo Error Error Feb 13, 2026 7:26am

Request Review

…errors

- Pin engines.node to "20.x" (matches .node-version) to ensure Vercel uses
  Node 20 LTS with prebuilt better-sqlite3 binaries instead of Node 24
- Update build:vercel to build all packages except site (API function needs
  workspace packages compiled to dist/)
- Sync pnpm-workspace.yaml onlyBuiltDependencies with package.json
- Fix TS2742 declaration emit errors in @objectos/permissions by adding
  explicit ServiceObject type annotations
- Remove unused ACCESS_LEVELS constant

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix deployment failure on Vercel for server and web Fix Vercel deployment: pin Node 20.x, build all packages, fix TS2742 errors Feb 13, 2026
Copilot AI requested a review from hotlong February 13, 2026 02:18
@hotlong hotlong marked this pull request as ready for review February 13, 2026 02:20
Copilot AI review requested due to automatic review settings February 13, 2026 02:20
@hotlong hotlong merged commit f63a28c into main Feb 13, 2026
3 of 5 checks passed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes Vercel deployment failures caused by Node version incompatibility and incomplete build configurations. The deployment was failing because Vercel selected Node 24.13.0 (no prebuilt better-sqlite3 binaries available) and the build script wasn't compiling all required workspace packages.

Changes:

  • Pin Node runtime to 20.x to ensure prebuilt native binaries are available
  • Update build:vercel filter to build all packages except @objectos/site (API serverless functions require compiled workspace packages)
  • Add explicit ServiceObject type annotations to fix TS2742 declaration emit errors in @objectos/permissions

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.

File Description
package.json Pin Node engine to 20.x and update Vercel build filter to exclude only site package
pnpm-workspace.yaml Add better-sqlite3 to onlyBuiltDependencies list
packages/permissions/src/objects/*.ts Add ServiceObject type annotations to exported objects to fix TypeScript declaration errors
packages/permissions/src/objects/organization_default.ts Remove unused ACCESS_LEVELS constant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants