Vercel edge function crashes: unsupported Node.js function
Closed this issue · 4 comments
I'm using Next.js authkit and noticed my deployments to Vercel succeed, but my middleware that triggers the authkit fails. Seems it's importing the @workos-inc\node
package and failing due to this line:
https://github.com/workos/workos-node/blob/main/src/workos.ts#L230
According to my Vercel logs, process.emitWarning
is not available on the Edge Functions that Vercel deploys to.
piste:build: ../../node_modules/.pnpm/@workos-inc+node@7.27.4_next@14.2.14/node_modules/@workos-inc/node/lib/workos.js
piste:build: A Node.js API is used (process.emitWarning at line: 173) which is not supported in the Edge Runtime.
Sure enough, when running my deployed Next.js app the middleware crashes.
Thanks for the report! I'll see about getting a fix up ASAP.
This is now released as v7.27.5, please let us know if you encounter any more problems.
@PaulAsjes Are there plans to bump the version in AuthKit to pull in v7.27.5 of the node library? Or is it on an automated CI?
It's not an automated CI sadly, but I have a PR up to release this ASAP: workos/authkit-nextjs#108