fix: polyfill Promise.try for pdfjs-serverless in Convex Node runtime#368
fix: polyfill Promise.try for pdfjs-serverless in Convex Node runtime#368
Conversation
PDF uploads were failing with "Promise.try is not a function" because pdfjs-serverless >=0.7.0 uses Promise.try, which is not available in Convex's current Node runtime. Polyfill it at the top of the action module so PDF processing works without downgrading the library. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughA runtime polyfill for Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Summary
Uncaught unhandledRejection: Promise.try is not a functionin thefileActions:saveFileConvex action.pdfjs-serverless>=0.7.0 usesPromise.try, which is not yet available in Convex's Node runtime.Promise.tryat the top of convex/fileActions.ts so PDF processing works without downgrading the library (downgrading would require jumping from 1.2.2 → 0.6.0, spanning ~2 years of fixes).Identified via Axiom query on
data.function.request_id— failure was a runtime crash, not a business-logic rejection, so paid users with small PDFs were still blocked.Test plan
pnpm typecheckpassespnpm test— 817 tests passPromise.try is not a functionno longer appears🤖 Generated with Claude Code
Summary by CodeRabbit