Sanity check needed - Cursor blaming 'anyApi' in client-side codegen for build issues.
Bug Report: Convex codegen consistently generates
anyApi from convex/server instead of proper client-side API typesEnvironment:
- OS: macOS 15.6.1 (darwin 24.6.0)
- Node.js: >=18
- Convex CLI: 1.26.2 (also tested 1.25.0)
- Convex package: 1.26.2 (also tested 1.25.0)
- Project: React Native app with Convex backend
Issue Description:
The
npx convex codegen command consistently generates incorrect API types in convex/_generated/api.js. Instead of generating proper client-side API types, it generates:This causes the application to crash because
anyApi from convex/server is server-side code that cannot be imported in client-side contexts.Steps to Reproduce:
1. Create a new Convex project:
npx convex dev --configure new2. Add a simple Convex function with proper validators
3. Run
npx convex codegen4. Check
convex/_generated/api.jsExpected Behavior:
The generated
api.js should contain proper client-side API types that can be imported and used in client applications.Actual Behavior:
The generated
api.js contains anyApi imports from convex/server, which causes runtime crashes when imported in client-side code.