-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incompatibility with Cloudflare Workers #964
Comments
Hey @Pelps12, you are 100% right, that's my bad for letting this one through. |
Merged
benoitgrelard
added a commit
that referenced
this issue
Feb 19, 2024
## Description Fixes #964 There was a leftover usage of Node's `Buffer` API. I have converted it to use the web platform's `TextEncoder` APIs instead. I wonder if there's an ESLint plugin that could be used to lint for usages of APIs incompatible with cloudflare workers/edge runtime as it seems easy to let something through without thoroughly testing every single API call. A quick google search didn't bring much up so far. ## 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.
Hey @Pelps12, v6.0.1 has now been published, it contains a few fixes including one for this issue. https://github.com/workos/workos-node/releases/tag/v6.0.1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Although buffer is globally defined in a node environment, in an edge environment like Cloudflare Workers, Buffer has to be imported as "node:buffer". Frameworks like SvelteKit handle the conversion of "buffer" to "node:buffer" internally Link. However, in constructEvent, because Buffer is assumed to be globally defined.
When deployed to Cloudflare, my SvelteKit application's webhook errors out with "Buffer not defined"
The text was updated successfully, but these errors were encountered: