terribleplan
CDCloudflare Developers
•Created by terribleplan on 3/2/2024 in #workers-help
unable to deploy sveltekit when using postgres
I've been trying to deploy sveltekit using postgres, but am unable to get it to work with
compatibility_flags = [ "nodejs_compat" ]
or node_compat = true
... I've made minimal repos showing it working with the default esbuild process wrangler does, while failing with sveltekid (which uses vite).
Is anyone doing this something similar successfully? Any hints on how to tweak my vite.config.js
to get it to work?
Failing (sveltekit): https://terrible.software/terribleplan/svelte-kit-pg-cloudflare
Working (no framework at all): https://terrible.software/terribleplan/raw-pg-cloudflare
If you want to deploy the examples yourself make sure you update the wrangler.toml
with a valid hyperdrive id.
The errors I am getting from vite are of this variety (depending on how exactly I tweak my wrangler config to use compatibility_flags = [ "nodejs_compat" ]
or node_compat = true
):
13 replies