Skip to content

fix: package zod with desktop sidecar - #165

Merged
akemmanuel merged 1 commit into
masterfrom
fix/package-sidecar-zod
Oct 8, 2026
Merged

akemmanuel merged 1 commit into
masterfrom
fix/package-sidecar-zod

Conversation

@touch2be

@touch2be touch2be commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • materialize the external zod runtime package under dist-electron/node_modules instead of relying on pnpm's symlink
  • copy that directory beside the unpacked Desktop Host through Electron Builder extraResources
  • extend package metadata and smoke coverage to require a real, non-symlinked Zod directory

Problem

The v0.6.3 Linux package starts Electron, but its Local Host exits before becoming healthy:

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'zod' imported from .../app.asar.unpacked/dist-electron/backend.js
Backend sidecar exited { code: 1, signal: null }

zod is deliberately external because bundling its cyclic v4 modules breaks schema construction. The existing node_modules/zod/**/* file rule does not follow pnpm's symlink into the packaged application, so no resolvable Zod package reaches the release artifact. Electron Builder also filters nested node_modules from ordinary files, so the materialized package is delivered explicitly with extraResources.

Verification

  • pnpm run check
  • pnpm vp test scripts/electron-package-metadata.test.ts
  • pnpm run build
  • pnpm run test:package-smoke
  • pnpm exec electron-builder --linux deb --publish never
  • extracted the resulting .deb, verified resources/app.asar.unpacked/dist-electron/node_modules/zod/package.json, and started its backend.js; it remained healthy through the 8-second smoke timeout
  • full local suite: 1,141 tests passed; three load-sensitive tests timed out/failed their timing bound when 217 workers ran concurrently, then all 13 tests passed with --maxWorkers=1; the browser audit could not launch Chromium because this Ubuntu host disables its usable sandbox

@akemmanuel
akemmanuel merged commit c0ebec5 into master Oct 8, 2026
2 checks passed
@akemmanuel
akemmanuel deleted the fix/package-sidecar-zod branch October 14, 2026 14:48
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.

2 participants