-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make emitWarning safe for workers (#1135)
## Description 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](https://workos.com/docs/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.
- Loading branch information
Paul Asjes
authored
Oct 2, 2024
1 parent
4812e86
commit e568f03
Showing
4 changed files
with
27 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters