OuiOuiCroissant
OuiOuiCroissant2mo ago

Edge runtime issues

Hi! I'm trying to implement WorkOS webhook validation in Convex but running into bundling issues. Setup: - Using @workos-inc/node v7.57.0 for webhook verification - Need to instantiate WorkOS class and call workos.webhooks.constructEvent() - Running in Convex edge runtime environment Issue: WorkOS announced edge runtime compatibility, but when I try to bundle the code, I get errors about Node.js-only modules being imported (even though I'm only using the webhook verification parts that should be edge-compatible). Error examples: - Could not resolve "node:crypto" - Could not resolve "node:http" - Other Node.js built-ins being pulled in during bundling Question: Is there a way to use only the edge-compatible parts of the WorkOS SDK without bundling the Node.js-specific modules? Or do you have a recommended approach for webhook verification in edge runtimes? I've tried marking it as an external package in Convex, but ideally I'd like to avoid the Node.js runtime if the edge parts truly work standalone. Thanks! 🙏
2 Replies
Convex Bot
Convex Bot2mo 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!
jamwt
jamwt2mo ago
hi! out of curiosity, did you ask the workos team about this? since this is about workos edge runtime compat and I agree, the library you're using still is depending on node stuff. so it's definitely not edge runtime compatible

Did you find this page helpful?