Skip to content

fix(api): declare viem as direct dep (was hoist-shadowed)#13

Merged
satyakwok merged 1 commit into
mainfrom
fix/api-add-viem-dep
May 7, 2026
Merged

fix(api): declare viem as direct dep (was hoist-shadowed)#13
satyakwok merged 1 commit into
mainfrom
fix/api-add-viem-dep

Conversation

@satyakwok
Copy link
Copy Markdown
Member

Bug

apps/api/src/routes/coinblast.ts imports recoverMessageAddress, isAddress, type Hex from viem but apps/api/package.json never 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:

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'viem' imported from /app/apps/api/src/routes/coinblast.ts

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.0 to apps/api/package.json (matching the version in packages/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.

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.
@satyakwok satyakwok merged commit 511833a into main May 7, 2026
@satyakwok satyakwok deleted the fix/api-add-viem-dep branch May 7, 2026 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant