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
Using Kinde in sveltekit for deployment on cloudflare, npm dev works perfectly.
But when you want to build the app for deployment to cloudflare, you get this.
> Using @sveltejs/adapter-cloudflare
✘ [ERROR] Could not resolve "node:http"
.svelte-kit/output/server/chunks/KindeSDK.js:8:22:
8 │ import * as http from "node:http";
╵ ~~~~~~~~~~~
Cannot use "node:http" when deploying to Cloudflare.
✘ [ERROR] Could not resolve "node:https"
.svelte-kit/output/server/chunks/KindeSDK.js:9:23:
9 │ import * as https from "node:https";
╵ ~~~~~~~~~~~~
Cannot use "node:https" when deploying to Cloudflare.
Is Kinde Auth for Sveltekit design to work with Cloudflare Adapter?
Unfortunately not, so I ended up using authjs which worked fine for me. I'm surprised no one at Kinde has made any effort to support this. Cloudflare workers is quite widespread from what I can see.
@calebltan I started using the SDK on Cloudflare Pages late September and it seemed to work fine, at least for the basics. That was version 1.3.0. It is possible a transitive dependency updated since you tried it.
I recently updated to the 2.1.0 version and found that broke Cloudflare a bit because of use of process. I've opened an issue for that, but it can be worked around with compatibility_flags = ["nodejs_compat"] in your wrangler.toml.
Prerequisites
Describe the issue
Using Kinde in sveltekit for deployment on cloudflare,
npm dev
works perfectly.But when you want to build the app for deployment to cloudflare, you get this.
Is Kinde Auth for Sveltekit design to work with Cloudflare Adapter?
Library URL
https://kinde.com/docs/developer-tools/sveltekit-sdk/
Library version
1.3.0
Operating system(s)
macOS
Operating system version(s)
Sanoma 14.3.1
Further environment details
See Cloudflare limits
The text was updated successfully, but these errors were encountered: