fix(den-api): build @openwork/types and @openwork/automations in the native build - #3527
Merged
Merged
Conversation
…native build The Automations feature (#3466) added @openwork/types/automations and @openwork/automations, whose node/default export conditions resolve to tsup-built dist/ files. Dockerfile.den was updated to build them, but the native build path (scripts/build.mjs) that Render uses was not, so the deployed den-api crashes at boot: ERR_MODULE_NOT_FOUND: .../@openwork/types/dist/automations.js imported from dist/routes/automations/index.js Build both packages (types first; automations depends on it) before the existing workspace package builds.
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
There was a problem hiding this comment.
Warden security clearance: clear. No new security issues found in this diff (416cccabb9dff29db8943fce321e2ba84b0407be). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run
benjaminshafii
added a commit
that referenced
this pull request
Aug 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Production den-api (Render native build,
/opt/render/project/src/...) crashes at boot since #3466 shipped:This is why Automations is currently unusable in prod.
Cause
#3466 added the
./automationssubpath to@openwork/typesand the new@openwork/automationspackage. Both resolve theirnode/defaultexport conditions to tsup-builtdist/files — the first exports in these packages that require a build step.packaging/docker/Dockerfile.denwas correctly updated to build them, but Render does not use that Dockerfile: it runs the native build (ee/apps/den-api/scripts/build.mjs), which pre-builds email/install-config/connect-link/enterprise-mcp-client/den-db but not these two packages.tsccannot catch it (it resolves thetypescondition tosrc/), and bun/tsx tests resolvebun/developmenttosrc/— the failure only exists at plain-Node boot.Fix
Build
@openwork/typesthen@openwork/automations(types first — automations depends on it) inbuild.mjs, with matchingbuild:*scripts following the existing pattern. 4-line diff. Redundant-but-harmless for the Docker path.Validation
Build-tooling change — no app-runtime behavior change, so no testkit tape; verified by running the production build path directly:
pnpm install— passedrm -rf packages/types/dist packages/automations/dist && pnpm --dir ee/apps/den-api run build— exit 0, both tsup builds ranpackages/types/dist/automations.jsandpackages/automations/dist/index.jsexist after buildee/apps/den-api:node --input-type=module -e "await import('@openwork/types/automations'); await import('@openwork/automations')"— printsresolve-ok(reproduces the exact prod resolution; fails on currentdev)After merge
Redeploy den-api on Render (manual redeploy lever added in
be9a95cea). A follow-up draft PR adds a CI job so this class of break is caught on PRs.cc @reachjalil