Skip to content

Fix CI android job: build web normally, skip static export#56

Merged
sparshsam merged 1 commit into
mainfrom
fix-ci-android-normal-build
Jun 28, 2026
Merged

Fix CI android job: build web normally, skip static export#56
sparshsam merged 1 commit into
mainfrom
fix-ci-android-normal-build

Conversation

@sparshsam

Copy link
Copy Markdown
Owner

Problem

The android CI job used CAPACITOR_BUILD=true which triggers output: export in next.config.ts. With output: export, Next.js requires ALL route handlers to have force-static or revalidate configured — but server-only routes like the MCP JSON-RPC endpoint (/api/mcp) need force-dynamic and cannot be statically pre-rendered.

This leads to cascading failures as each route hits the same check.

Fix

Build the web app normally in the android CI job (without CAPACITOR_BUILD). The normal next build doesn't check API routes for static export compatibility.

The Android Gradle build only needs native Java/Kotlin compilation — it doesn't use web assets. We create an empty out/ directory so npx cap sync can succeed and update the Android plugin registrations needed for compilation.

Verification

  • npm run typecheck
  • npm run lint ✅ (0 errors)
  • npm --workspace apps/web run build

Remaining route changes (already on main from prior PRs)

The following were correctly landed as safe force-static additions:

  • /api/mcp/tokens — returns 401 when no auth (safe stub)
  • /api/mcp/tokens/[id] — returns 401 with placeholder params (safe stub)
  • /api/identify — has try-catch (safe stub)
  • /auth/callback — falls through to /login redirect when no code param (safe stub)

The static export build (CAPACITOR_BUILD=true with output: export)
fails because server-only API routes (MCP handler with force-dynamic)
cannot be statically pre-rendered.

Fix: build web normally (no CAPACITOR_BUILD) — this verifies the
Next.js app compiles correctly. The Android Gradle build only
needs native Java/Kotlin compilation, not web assets. Create
an empty out/ directory for Capacitor sync to succeed.
@vercel

vercel Bot commented Jun 28, 2026

Copy link
Copy Markdown

Deployment failed 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/sparsh-sams-projects?upgradeToPro=build-rate-limit

@sparshsam sparshsam merged commit 1be40c7 into main Jun 28, 2026
1 of 3 checks passed
@sparshsam sparshsam deleted the fix-ci-android-normal-build branch June 28, 2026 06:32
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