-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Description
Describe the problem
Importing Stripe https://github.com/stripe/stripe-node in a +server endpoint https://kit.svelte.dev/docs/routing#server will work fine locally, but break the build when deployed to Cloudflare.
This is likely a critical use case for many SvelteKit projects on Cloudflare, and there seems to be some awareness of the problem as there are several issues like this: #3564 (comment) on the books, but there does not seem to be a replicable, working solution in any of them.
The Cloudflare team are clearly aware of the complexities around using Stripe in Workers, and announced "native support" for Stripe here: https://blog.cloudflare.com/announcing-stripe-support-in-workers but the demo repo referenced in that blog post uses a Webpack config: https://github.com/stripe-samples/stripe-node-cloudflare-worker-template/blob/main/webpack.config.js which rules it out as a SvelteKit solution.
Describe the proposed solution
At a minimum, an official, documented example of whatever set of configs is required to allow the import of Stripe in a +server endpoint without breaking the build, for a @sveltejs/adapter-cloudflare integration, somewhere in the SvelteKit repo or docs.
Even better would be something like this for @sveltejs/adapter-cloudflare integrations: https://github.com/srmullen/sveltekit-stripe
Alternatives considered
No response
Importance
i cannot use SvelteKit without it
Additional Information
The Cloudflare team is contributing to SvelteKit, which is great to see: #6441 - @jrf0110 do you have any thoughts on this issue, or how Cloudflare might be able to help make this integration work?