fix(api): declare viem as direct dep (was hoist-shadowed)#13
Merged
Conversation
apps/api/src/routes/coinblast.ts has imported viem since the launchpad PR (recoverMessageAddress + isAddress for admin signature auth), but viem was never listed in apps/api/package.json — only in packages/chain and apps/indexer. tsx in dev/host pnpm hoist made it resolve anyway, but the apps/api Dockerfile filter-installs only @sentriscloud/indexer-api and its declared deps, so the compiled container has no viem under apps/api/node_modules and crashes at ESM resolve time: Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'viem' imported from /app/apps/api/src/routes/coinblast.ts Symptom only visible after rebuild — the running container kept serving the pre-import source until today's rebuild for the BigInt parse fix surfaced it. Pin to ^2.21.0 to match packages/chain + apps/indexer.
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.
Bug
apps/api/src/routes/coinblast.tsimportsrecoverMessageAddress, isAddress, type Hexfromviembutapps/api/package.jsonnever declared the dep. Local dev resolved it via pnpm workspace hoist; the production Dockerfile filter-install (pnpm install --filter @sentriscloud/indexer-api...) does not, so the container crashes at ESM resolve time:The 44h-uptime testnet container was running pre-PR-#11 source where this didn't exist; today's rebuild for #12 surfaced it.
Fix
Add
viem: ^2.21.0toapps/api/package.json(matching the version inpackages/chain+apps/indexer).Verified
Rebuilt + recreated testnet api container — comes up healthy, all 5 BigInt-fix routes from #12 return 400 on bad input as designed.