If you currently try to build a next project that uses workos-node you get the following error:
./node_modules/@workos-inc/node/lib/workos.js
A Node.js API is used (process.emitWarning at line: 178) which is not supported in the Edge Runtime.
This is because despite the fact that we have an if/else statement checking for whether process exists, the Next build step just sees a call to process.emitWarning and spits out that error. This moves the definition of emitWarning to the worker index.ts to prevent that error.
Documentation
Does this require changes to the WorkOS Docs? E.g. the API Reference or code snippets need updates.
[ ] Yes
If yes, link a related docs PR and add a docs maintainer as a reviewer. Their approval is required.
Description
If you currently try to build a next project that uses workos-node you get the following error:
This is because despite the fact that we have an if/else statement checking for whether
process
exists, the Next build step just sees a call toprocess.emitWarning
and spits out that error. This moves the definition ofemitWarning
to the worker index.ts to prevent that error.Documentation
Does this require changes to the WorkOS Docs? E.g. the API Reference or code snippets need updates.
If yes, link a related docs PR and add a docs maintainer as a reviewer. Their approval is required.