Edge runtime 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!
