How do I start an Astro + Pages Function dev server if -- <command>
is being deprecated?
#5617
AVGVSTVS96
started this conversation in
General
Replies: 1 comment 2 replies
-
You need to run your build command with some kind of watch mode (i.e, rebuild on file change), and run This was mentioned in the deprecation issue: #5211 (comment) I'm not familiar with Edit: Note that live-reload is currently broken (#5351) |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Cloudflare Wrangler Deprecations states that
-- <command>, --proxy, and --script-path
in wrangler pages dev will be deprecated soon.My Application
I have an Astro app with a GPT chat page which uses a pages function to communicate with OpenAI and my frontend. I use Bun as a package manager and am on Wrangler 3.48.0.
My current workflow
I currently start my dev environment by running
bunx wrangler pages dev -- bun run dev
to start a dev server for both my pages function and Astro frontend. I then navigate to localhost:8787 and am able to access both my UI and, through it, the OpenAI API using the CF pages function. This allows me to test my full application as if it was deployed on Cloudflare.If this is deprecated, how will I be able to run a dev server?
Cloudflare Wrangler Deprecations states:
So I will have to rebuild my Astro app and run the command in
dist
directory every time I make a change? No more hot reloading?I tested
bunx wrangler pages dev dist
, this worked, but I have to rebuild and restart the server after every change.-- bun run dev
is the only way I know of to run my frontend dev server and allow it to communicate with my backend through Wrangler, as if it's deployed on CF while enabled hot reloading.I may be missing something because I'm a new programmer and am still learning about CF and Wrangler, I haven't seen much documentation applicable to this scenario. Any help would be greatly appreciated!
I'm hoping theres still a way to test my app in a standard dev environment after
-- <command>
is deprecated, I really like how minimal it is to use a pages function to handle OpenAI API communication in my Astro app and this is the only way I know of to test it without having to rebuild and restart after every change.Beta Was this translation helpful? Give feedback.
All reactions