thewb
thewb3w ago

Dynamic require of "stream" is not supported

Getting this error when deploying on Vercel
2 Replies
Convex Bot
Convex Bot3w ago
Thanks for posting in <#1088161997662724167>. Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets. - Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.) - Use search.convex.dev to search Docs, Stack, and Discord all at once. - Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI. - Avoid tagging staff unless specifically instructed. Thank you!
thewb
thewbOP3w ago
import { headers } from "next/headers"; import Stripe from "stripe"; import { ConvexHttpClient } from "convex/browser"; import { stripe } from "@/lib/stripe"; import { env } from "process"; import { api } from "../../../../../convex/_generated/api"; const convex = new ConvexHttpClient(process.env.NEXT_PUBLIC_CONVEX_URL!); export async function POST(req: Request) { const body = await req.text(); const signature = headers().get("Stripe-Signature") as string; if (!env.STRIPE_WEBHOOK_SECRET) { return new Response("Missing STRIPE_WEBHOOK_SECRET", { status: 500 }); } let event: Stripe.Event; Also tried with import { ConvexClient } from "convex/browser"; Call stack eval nodemodules.pnpm\convex@1.18.2@clerk+clerk-react@5.22.8_react-dom@18.3.1_react@18.3.1react@18.3.1react-do_a6pe3624vgfhu2tivlhxgo7czi\node_modules\convex\dist\esm\browser\simple_client-node.js (12:1) ../common/temp/node_modules/.pnpm/ws@8.18.0_bufferutil@4.0.9_utf-8-validate@5.0.10/node_modules/ws/lib/stream.js nodemodules.pnpm\convex@1.18.2@clerk+clerk-react@5.22.8_react-dom@18.3.1_react@18.3.1react@18.3.1react-do_a6pe3624vgfhu2tivlhxgo7czi\node_modules\convex\dist\esm\browser\simple_client-node.js (38:20) Anybody? 🙏🏻 Ok fixed it by changing to const response = await fetch( ${process.env.NEXT_PUBLIC_CONVEX_URL}/api/query?path=users:getUserByClerkId, { method: "POST", headers: { "Content-Type": "application/json", }, body: JSON.stringify({ args: { clerkId: userId }, }), } );

Did you find this page helpful?