Fix CI android job: build web normally, skip static export#56
Merged
Conversation
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.
|
Deployment failed with the following error: Learn More: https://vercel.com/sparsh-sams-projects?upgradeToPro=build-rate-limit |
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.
Problem
The android CI job used
CAPACITOR_BUILD=truewhich triggersoutput: exportin next.config.ts. Withoutput: export, Next.js requires ALL route handlers to haveforce-staticorrevalidateconfigured — but server-only routes like the MCP JSON-RPC endpoint (/api/mcp) needforce-dynamicand 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 normalnext builddoesn'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 sonpx cap synccan 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-staticadditions:/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)