fix: add --import tsx to den-api node invocation in den-dev compose - #3394
Open
shahtirth07 wants to merge 1 commit into
Open
fix: add --import tsx to den-api node invocation in den-dev compose#3394shahtirth07 wants to merge 1 commit into
shahtirth07 wants to merge 1 commit into
Conversation
…refs different-ai#3392) The drizzle-kit push step in the den service command already uses --import tsx, but the following node invocation running den-api's dist/main.js didn't. Since OPENWORK_DEV_MODE=1 loads den db from source, and schema.ts re exports without a file extension, native ESM resolution fails without the tsx loader. Does not address the drizzle-kit MySQL index bug also described in different-ai#3392: that one needs reproduction against the real stack before a fix is attempted.
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
Someone is attempting to deploy a commit to the Different AI Team on Vercel. A member of the Team first needs to authorize it. |
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
--import tsxto thenode .../den-api/dist/main.jsinvocation inpackaging/docker/docker-compose.den-dev.yml, so den-api can resolve its extensionless source imports when running underOPENWORK_DEV_MODE=1.Why
OPENWORK_DEV_MODE=1, den-api loadsden-dbfrom source rather than the builtdist/.ee/packages/den-db/src/schema.tsdoesexport * from "./schema/index"without a file extension, which native Node ESM resolution can't resolve without a loader. Thedrizzle-kit pushstep earlier in the samedenservice command already uses--import tsxfor this reason; the secondnodeinvocation starting the API server didn't, causingError [ERR_MODULE_NOT_FOUND]: Cannot find module '.../schema/index'and preventingdenfrom starting.Issue
denfrom starting against local MySQL (drizzle-kit index syntax + missing --import tsx) #3392 (partial — see Out of scope)Scope
packaging/docker/docker-compose.den-dev.yml: add--import tsxto thedenservice's API start step, mirroring the flag already used on thedrizzle-kit pushstep in the same command.Out of scope
denfrom starting against local MySQL (drizzle-kit index syntax + missing --import tsx) #3392 also reports a separate drizzle-kit bug:pushallegedly generates invalid SQL (double-backtick-wrapped identifier) for the prefix-length index onee/packages/den-db/src/schema/auth.ts:207. I was not able to reproduce that bug in isolation — tested with the exact pinneddrizzle-kit@0.31.9/drizzle-orm@0.45.1versions and a matching table shape (including thecustomTypeid columns) against a real MySQL instance, andpushsucceeded cleanly every time. That part needs reproduction against the actual MySQL 8.4 container before a fix is attempted, so it's intentionally not included here. Leaving den-dev docker-compose: two bugs preventdenfrom starting against local MySQL (drizzle-kit index syntax + missing --import tsx) #3392 open rather than closing it.Testing
Ran
docker compose -f packaging/docker/docker-compose.den-dev.yml up --builddocker compose -f packaging/docker/docker-compose.den-dev.yml run --rm den node --import tsx /app/ee/apps/den-api/dist/main.js(isolated check of the fixed command)Result
ERR_MODULE_NOT_FOUNDno longer occurs; den-api startsCI status
Manual verification
--import tsxfix to thedenservice commanddocker compose -f packaging/docker/docker-compose.den-dev.yml uprun --rmcommand>Evidence
Risk
Rollback