boggin
Explore posts from serversCDCloudflare Developers
•Created by boggin on 7/22/2024 in #pages-help
dep problems sveltekit cloudflare-adapter when building
I can't build because of adapter-cloudflare's deps being wrong node modules? but the error must come from the adapter....
When I run build, it spits out many errors like:
from the deps like
youch
. When I npm ls youch
, it spits out:
So the adapter is throwing the error of an incompatibility essentially of its own dependencies....
adapter-cloudflare@4.6.13 replies
CDCloudflare Developers
•Created by boggin on 1/9/2024 in #general-help
Wasm problem with Sveltekit, Cloudflare Pages and Resvg.
I'm trying to implement dynamic opengraph images, and so far the most promising solution has been satori + Resvg on a server endpoint (turns into a cloudflare pages function). It works beautifully everywhere except deployed on Cloudflare.
The wasm package I'm trying to use is Resvg. which I import via fetch using Vite's
I tried using vite plugins for directly importing wasm modules (like
"CompileError: WebAssembly.instantiate(): Wasm code generation disallowed by embedder"
I found this "workaround" which does not seem to work:
https://github.com/cloudflare/workers-sdk/issues/1366
which defines a wasm Memory
to a 512 pagesize to be able to work on Cloudflare.The wasm package I'm trying to use is Resvg. which I import via fetch using Vite's
..wasm?url
directive because Vite doesn't support ESM wasm modules especially in SSR.I tried using vite plugins for directly importing wasm modules (like
vite-plugin-wasm
and also mentioned here https://github.com/vitejs/vite/issues/8882) with no success because then it throws a cannot find module 'wbg'
error.
I understand there are tons of factors frameworks and tools associated with this but if anyone can help me at all tha'd be amazing37 replies
CDCloudflare Developers
•Created by boggin on 12/1/2023 in #pages-help
sveltekit and node errors on build
Trying to use Sveltekit, with Supabase and Drizzle ORM preferably.
- I've put
nodejs_compat
in the compatibility flags in both preview and production
- Node version is 18 (set via environment variable)
- I'm using build engine 1
- Using Sveltekit.
- my postgres client instantiation is in $lib/server/
which I'm told makes it definitely server only
- Using the cloudflare sveltekit adapter.
Cant seem to find anything online why it'd be throwing this.7 replies
CDCloudflare Developers
•Created by boggin on 7/22/2023 in #pages-help
Sveltekit and private images related: ERROR 9425 Image access denied: sig query-string argument is n
So trying to implement the signed URLs of private images in Sveltekit. I've done absolute minimal to translate the given URL signing solution at https://developers.cloudflare.com/images/cloudflare-images/serve-images/serve-private-images-using-signed-url-tokens
But it doesnt seem to work because of :
ERROR 9425: Image access denied: sig query-string argument is not properly hex-encoded (must be 64 hex chars)
8 replies
CDCloudflare Developers
•Created by boggin on 7/17/2023 in #pages-help
KV access in a Sveltekit dev environment
Hi there. Appreciate the help in advance. I'm having the worst time trying to figure out if its possible to use a KV store in a dev environment. I'd like to use a full-on test KV where I can save keys and such.
It seems everything that I've tried,
in my wrangler.toml. (random hash ids for example's sake) console logging
platform.env
on a server endpoint on my Sveltekit app is only available deployed in production. I'm using npx wrangler pages dev .svelte-kit/cloudflare
once built, within my wrangler.toml. (random hash ids for example's sake) console logging
platform.env
is always undefined
though the wrangler pages dev.
I've done wrangler kv:namespace create test
and used preview_id just as the docs say, but I just can never access platform
Is it possible to have full KV functionality in a local dev environment? And if so, I don't understand how platform
connects using Sveltekit.7 replies