ubiquitous-invention/apps/collab-server/src
Randall Stillwell b992db5b3e collab: replace createRequire shim with normal imports
The collab server was using createRequire() with hardcoded relative paths
(../../../packages/database/package.json, ../node_modules/@hocuspocus/server/...)
to grab `eq` from drizzle-orm and `Forbidden` from @hocuspocus/common. That
worked under tsx in dev but fell apart in the bundled prod image because
those paths don't exist there and pnpm's symlink topology in the runtime
node_modules wasn't reachable from inside the bundled dist file.

Result at runtime: Cannot find module '@hocuspocus/common' on every
collab restart, infinite crash loop.

Switch both to plain ESM imports — tsup bundles them into dist/index.mjs
directly, no runtime resolution needed. Add @hocuspocus/common and
drizzle-orm as explicit deps so they're properly tracked.

Verified locally: bundle now resolves cleanly with no createRequire calls
(actually shrinks from 304 KB to 102 KB after dead-code elimination).

Made-with: Cursor
2026-04-28 15:14:03 -05:00
..
index.ts collab: replace createRequire shim with normal imports 2026-04-28 15:14:03 -05:00
utils.ts feat: Full project management application scaffold 2026-03-26 22:39:16 -05:00