`unstable_dev` with Cloudflare Pages
is there any way to use
unstable_dev
with Cloudflare Pages yet? when testing a svelte-kit build, i tried
the worker runs, but somehow it can't find the assets7 Replies
pnpm wrangler pages dev
is broken as hell too, why pnpm wrangler pages dev .svelte-kit/cloudflare
can find the functions but when inside .svelte-kit
or cloudflare
, running it again with pnpm wrangler pages dev cloudflare
or .
can't find the functions (No functions. Shimming...
)If youβre using sveltekit, Iβd recommend using its built-in dev environment (pnpm dev)
umm, i'm running those generated functions, so i'm not sure what you meant here
Then there would be no
platform
property, no? i would like to access Cloudflare's bindings inside my load
functions, or server-side in general. pnpm dev
would not work because nothing is running workerd
, so I wanted to build the project and test it with wrangler
, just like the docs suggests:
basically, two things broke:
1. unstable_dev
to preview a built-with-sveltekit output doesn't work
2. wrangler pages dev
to preview a built-with-sveltekit output doesn't work
i'm not actively working on this anymore, but that is my experience with local Cloudflare PagesI use the miniflare api to set the bindings in the hooks file
Then miniflare v2 it is. I'm figuring out how to use miniflare v3 here, unfortunately
getBindings
so it's no longer possible to do that. So im stuck on miniflare v2 until either getBindings is added back, or another solution is foundI guess this might be the issue to pay attention to
https://github.com/cloudflare/miniflare/issues/585
GitHub
Missing migration guide for usage of
getBindings()
Β· Issue #585 Β·...Previously in V2, the getBindings() method was useful for working with SvelteKit and KV, D1, etc. locally. However, this method has been removed without new recommendations for retrieving the bindi...