Deploying SvelteKit application for NodeJS

I get the following errors: https://pastify.xyz/show/O9sIQ0sq9mAjxCWlESRq I have compatibility_flags = [ "nodejs_compat" ] enabled in my wrangler.toml. The application can be found at https://github.com/hamza1311/firestorm/tree/trpc-endpoints How do I deploy this application? Is it impossible to use Cloudflare Workers? I get the same error when using pages adapter as well
1 Reply
James
James12mo ago
Unfortunately things like https, stream, crypto, etc. are node.js modules that aren't polyfilled that way, yet. Some of them can (and will) work when importing node:crypto in future. You could try adding the older nodejs polyfills via node_compat=true, which might help for things like util, but not https, etc. To make this work, you'll likely have to dig into each of its dependencies and see what they're using, and if you can replace/stub/polyfill as necessary.