
How I Fixed Genkit's gRPC Edge Runtime Error on Vercel (And What I Learned)
If you've tried deploying a Next.js app with Google Genkit to Vercel and hit this error: Module not found: Can't resolve '@grpc/grpc-js' or any Edge Runtime incompatibility error related to gRPC — this post is for you. The Problem Genkit uses gRPC under the hood for some of its internal communication. Vercel's Edge Runtime does not support Node.js native modules like gRPC. This means any Genkit import in a file that gets bundled for Edge Runtime will cause the entire deployment to fail. The error is cryptic. The build logs don't always point directly at Genkit. I spent hours chasing TypeScript errors and stale commits before finding the real issue. The Fix Remove the Genkit AI module entirely from any file that runs on the Edge Runtime. In my case, I had to remove the entire AI integration from the API route and move the logic server-side only. If you're using Next.js, make sure your Genkit calls only happen in files that run in the Node.js runtime, not Edge. Add this to your API route
Continue reading on Dev.to Webdev
Opens in a new tab
