This repository was archived by the owner on Jun 9, 2026. It is now read-only.
fix(deploy): restore dist src runtime paths - #193
Merged
Merged
Conversation
Keep the deploy entrypoint, module alias, and generated Prisma client copy aligned with the built dist/src layout so ECS tasks can start successfully. Co-authored-by: Cursor <cursoragent@cursor.com>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
dist/srclayout (dist/src/otel.js,dist/src/main.js).srcmodule alias and bootstrap import back atdist/srcso runtime absolute imports resolve.dist/src/generated/prismaimport path.Test plan
docker build -t election-api-dev-deploy-fix -f deploy/Dockerfile .docker run --rm --entrypoint node election-api-dev-deploy-fix -e "require('./module-alias'); require('src/prisma/prisma.service.js'); require('./dist/src/generated/prisma'); console.log('runtime-paths-ok')"docker run --rm --entrypoint node election-api-dev-deploy-fix -e "require.resolve('./dist/src/otel.js'); require.resolve('./dist/src/main.js'); console.log('entrypoint-files-ok')"Root cause
The deploy image still builds into
dist/src, but the SWC prep PR changed runtime references as if the image emitted a flatdistlayout. ECS tasks could not start the app, so the service never became healthy and the deployment circuit breaker stopped the dev deploy.Made with Cursor
Note
Medium Risk
Touches production entrypoints and module resolution; wrong paths would prevent containers from starting, but the change realigns paths with the existing build layout.
Overview
Restores production runtime paths so they match Nest’s
dist/srcbuild output instead of a flatdistlayout that broke ECS deploys.start:prod,deploy/entrypoint.sh, andmodule-alias.jsnow load./dist/src/otel.jsanddist/src/main.js, and map thesrcalias todist/srcso absolutesrc/...imports resolve.src/main.tsagain importsmodule-aliasfrom the app root via../../module-alias(correct relative path fromdist/src/main.js). The Dockerfile comment is updated to describe thedist/src/generated/prismacopy path; behavior is unchanged.Reviewed by Cursor Bugbot for commit 131cb25. Configure here.