Some help with wrangler pages dev with vite?

I can't seem to find the commands and config to run my sveltekit app in dev environment with local or remote bindings.
1 Reply
boggin
bogginOP3w ago
So far, the closest to achieving it is something like yarn wrangler pages dev --proxy 5173 --r2=testing --compatibility-flags='nodejs_compat' -- npx vite dev. There are deprecation warnings so I'd like to know the way wrangler is going with the equivalent command. when I run bunx wrangler pages dev it only runs what is built and/or doesn't show any logs from Vite's dev runtime. when I run bunx wrangler pages dev ./ --command \"bun run vite\" it looks like it's running but nothing is actually served on my 5173 port. I don't understand the --proxy flag enough to understand how I'd plug the vite dev runtime into it correctly. Such as running wrangler pages dev at port 4173 and vite on 5173 and then there's getPlatformProxy which is only mentioned but not wholly explained in the documentation. Please someone help. I am using the svelte-adapter-cloudflare adapter which mentions getPlatformProxy (no explanation besides offering an option), I've set environment variables to a test KV and a test R2, I've attached the getplatformProxy to event in my hooks.servers.ts, and my platform.env still doesnt show anything when running any of the above dev environment commands. ? Wondering about the deprecation? wrangler says to clarify a directory if using --command, but I want it to run from Vite, not the build
Want results from more Discord servers?
Add your server