Skip to content

Support Stripe in @sveltejs/adapter-cloudflare integrations #6547

@fredguest

Description

@fredguest

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationp2-nice-to-haveSvelteKit cannot be used by a small number of people, quality of life improvements, etc.pkg:adapter-cloudflare

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions