Skip to content

fix(kds-mobile): run api-contract codegen without the nx project graph - #532

Merged
mnindrazaka merged 1 commit into
mainfrom
claude/affectionate-franklin-lbafqz
Sep 17, 2026
Merged

mnindrazaka merged 1 commit into
mainfrom
claude/affectionate-franklin-lbafqz

Conversation

@mnindrazaka

Copy link
Copy Markdown
Collaborator

Context

Follow-up to #531, which was squash-merged and captured only the first of its two commits. The eager-bundle fix landed on main; this one-line codegen fix did not, so eas build for kds-mobile still fails.

Problem

eas-build-post-install on main runs:

NX_DAEMON=false npx nx run api-contract:generate:ts

nx run constructs the Nx project graph before executing anything, and graph construction runs every plugin in nx.json — including @nx-go/nx-go, which shells out to go list -m -json. The EAS build image ships Node but no Go toolchain, so the hook dies before the TypeScript contract is generated:

/bin/sh: 1: go: not found

NX   Failed to process project graph.
The "@nx-go/nx-go" plugin threw an error while creating dependencies:
Command failed: go list -m -json

npm run eas-build-post-install exited with non-zero code: 1

The hook needs the generated contract because libs/api-contract/src/index.ts re-exports ./__generated__/ts, and __generated__ is gitignored — so it is never uploaded to EAS and has to be regenerated there.

Change

Invoke kubb directly. It is the entire body of the generate:ts target minus the rm -rf, which is pointless on a fresh EAS checkout, and it needs nothing but node:

cd ../../ && node tools/scripts/eas-build-post-install.mjs . apps/kds-mobile \
  && cd libs/api-contract && npx kubb --config kubb.config.ts

Verification

Ran the real npm run eas-build-post-install from apps/kds-mobile with go stripped from PATH, reproducing the EAS image's condition:

  • which go → nothing found
  • script exited 0
  • 1053 files generated into libs/api-contract/src/__generated__/ts

Tradeoff

The kubb invocation is now duplicated between libs/api-contract/project.json and this hook, so a future change to the generate:ts target needs the same change here. The alternative — a root .easignore shipping the generated files instead of regenerating them — relies on gitignore-style negation through an already-excluded __generated__ directory, which is fragile and untestable without a real EAS run.

CI only runs the path-filtered unit suites, and this file has no test coverage; the real check is the next nx build kds-mobile.

🤖 Generated with Claude Code

https://claude.ai/code/session_01MPSwsKvPMpTwJQ5PD5pWZ2


Generated by Claude Code

`nx run api-contract:generate:ts` builds the project graph first, which
makes @nx-go/nx-go shell out to `go list -m -json`. The EAS build image
has no Go toolchain, so eas-build-post-install died with "go: not found"
before the TypeScript contract was generated.

Invoke kubb directly instead — it is the entire body of the generate:ts
target and needs nothing but node.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MPSwsKvPMpTwJQ5PD5pWZ2
@vercel

vercel Bot commented Sep 17, 2026

Copy link
Copy Markdown

Deployment failed for project gatherloop-pos with the following error:

Resource is limited - try again in 24 hours (more than 100, code: "api-deployments-free-per-day").

Learn More: https://vercel.com/m-nindra-zakas-projects-ae6b8849?upgradeToPro=build-rate-limit

@mnindrazaka
mnindrazaka merged commit 446ccb0 into main Sep 17, 2026
3 of 6 checks passed
@mnindrazaka
mnindrazaka deleted the claude/affectionate-franklin-lbafqz branch September 17, 2026 11:53
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.

2 participants