fix(gateway): inline runtime into bundle (0.46.x backport)#711
Merged
Conversation
The gateway bundle imported @fro-bot/runtime as an external specifier that resolved to its src/index.ts entry, which is absent from the runtime image — crash-looping on boot with ERR_MODULE_NOT_FOUND. Inline the runtime into the gateway bundle (matching the action tier), drop the now-dead runtime copy from the image, and add a CI smoke that builds and boots the image to catch packaging regressions. Fixes #707
Owner
Author
Backport complete: gateway packaging fix on 0.46.xOpened the maintenance backport PR. No tags or releases were created, and nothing was merged. Pull request: #711 — fix(gateway): inline runtime into bundle (0.46.x backport)
What it doesBackports the gateway image crash-loop fix ( The backport is minimal — only the two essential packaging changes:
The Verification
Run Summary
|
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.
Summary
Backports the gateway image crash-loop fix onto the 0.46.x maintenance line so deployers pinned below
v0.47.0get a working gateway image — without pulling in the newerv0.47.0+features (announce webhook, mention loop).Problem
The gateway Docker image crash-looped on boot with
ERR_MODULE_NOT_FOUNDfor@fro-bot/runtime. The gateway bundle imported@fro-bot/runtimeas an external specifier that resolved to itssrc/index.tsentry, which is absent from the runtime image.Fix
This cherry-picks the essential packaging changes onto
0.46.x:packages/gateway/tsdown.config.ts— adds anoExternalpredicate that inlines@fro-bot/runtime(and its subpaths) into the gateway bundle, makingdist/main.mjsself-contained.deploy/gateway.Dockerfile— removes the now-deadCOPY --from=build /workspace/packages/runtime/...lines, since the runtime is bundled into the gateway output.The backport is intentionally minimal: it contains only the two packaging changes above and does not introduce any
v0.47.0+feature work.Verification
pnpm --filter @fro-bot/runtime buildandpnpm --filter @fro-bot/gateway buildboth succeed.grep -c 'from "@fro-bot/runtime"' packages/gateway/dist/main.mjsreturns 0 — the bundle has zero bare runtime imports and is fully self-contained.deploy/gateway.Dockerfileand running the image with no secrets boots cleanly to the config-load stage and exits withMissing required secret: DISCORD_TOKEN. There is noERR_MODULE_NOT_FOUND— the module-resolution crash is gone.Base branch
This PR targets
0.46.x(the maintenance line), notmain.