You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've recently started using Svix to handle Clerk webhooks. For this, I tried adding the svix JS package to my Astro project to validate webhook signatures. Unfortunately, this ended up doubling my project's bundle size from 1 MB to 2 MB. 😱
As a workaround, I copied the following code and added @stablelib/base64 + fast-sha256 as dependencies:
thrownewError("Expected payload to be of type string or Buffer. Please refer to https://docs.svix.com/receiving/verifying-payloads/how for more information.");
Hey,
I've recently started using Svix to handle Clerk webhooks. For this, I tried adding the svix JS package to my Astro project to validate webhook signatures. Unfortunately, this ended up doubling my project's bundle size from 1 MB to 2 MB. 😱
As a workaround, I copied the following code and added
@stablelib/base64
+fast-sha256
as dependencies:svix-webhooks/javascript/src/index.ts
Lines 803 to 939 in d0443bd
Surprisingly, this had almost no impact on the bundle size.
I'm no expert on ESM or bundling, but there seems to be a problem with the code's structure that prevents proper tree shaking.
This is especially concerning in a constrained environment like Cloudflare Workers/Pages, where bundle size is (even more) important.
(Happy to provide more info if needed.)
The text was updated successfully, but these errors were encountered: