Skip to content

Fix packed prod-only Prisma schema engine startup failure #484

Description

@realproject7

Parent: #465
Blocks: #472

Problem

Final local publish-readiness verification on main 1.2.93 still fails in the real packed prod-only startup smoke.

npm install, npm run typecheck, npm test, and npm run app:build pass under Node 20.20.2 / npm 10.8.2. npm audit --omit=dev reports 0 vulnerabilities. However npm run preflight fails at the Prod-only start smoke (packed tarball install + boot) stage.

The packed tarball installs with --omit=dev, removed deps are absent, and #481's browser auto-open guard is working, but the real bin exits during server startup before /api/auth/status is served.

Reproduction

On local main after PR #483:

source ~/.nvm/nvm.sh && nvm use 20.20.2
npm install
npm run typecheck
npm test
npm run app:build
npm run preflight

Observed preflight failure:

=== Prod-only start smoke (packed tarball install + boot) ===
added 69 packages in 7s
  ✓ tarball installed prod-only (--omit=dev, scripts on)
  ✓ removed deps absent from prod install (@aws-sdk/client-s3, react, vite)
  ✗ server did not serve /api/auth/status within 60s (bin exitCode=1)
  ✗ server did not serve the prebuilt web UI at /

--- captured server output ---
Prisma schema loaded from app/prisma/schema.prisma
Datasource "db": SQLite database "local.db" at "file:/.../home/.plotlink-ows/data/local.db"

Error: Schema engine error:

  ✗ Database setup failed (prisma db push).
    schema:   /private/var/.../node_modules/plotlink-ows/app/prisma/schema.prisma
    database: file:~/.plotlink-ows/data/local.db
    reason:   Command failed: /Users/cho/.nvm/versions/node/v20.20.2/bin/node /private/var/.../node_modules/prisma/build/index.js db push --schema /private/var/.../node_modules/plotlink-ows/app/prisma/schema.prisma --skip-generate

Important context

Expected behavior

npm run preflight should pass end-to-end on the packed tarball under Node 20.x/npm 10.x:

  • npm pack
  • temp npm install --omit=dev with scripts on
  • removed deps absent
  • real bin starts with fresh HOME and PLOTLINK_OWS_NO_OPEN=1
  • /api/auth/status responds
  • / serves the prebuilt web UI

Acceptance

  • Diagnose the exact Prisma schema-engine failure in the packed prod-only install. Include the root cause in the PR body.
  • Fix the packed install/start path without weakening dependency hygiene.
  • Add or update focused regression coverage so this failure mode stays caught.
  • Verify under Node 20.x/npm 10.x:
    • npm run typecheck
    • npm test
    • npm run app:build
    • npm run preflight
  • Confirm npm audit --omit=dev remains clean.
  • Leave Operator Gate: final npm publish readiness check, no publish #472 open until the operator reruns final publish-readiness verification.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions