#5469 Add a warning about `-- command` and `--proxy` in `wrangler pages dev` not working on PowerShell
Original bug #965 was fixed in wrangler 2.0.5. The `-- command` and `--proxy` features are now deprecated with clear migration warnings. Adding PowerShell-specific warning for deprecated feature provides minimal value.
Close - underlying issue fixed, feature deprecated with clear warnings
Analysis Report
Issue Review: cloudflare/workers-sdk#5469
Summary
Feature request to add a warning about -- command and --proxy options in wrangler pages dev not working correctly on PowerShell.
Findings
- Created: 2024-04-02
- Updated: 2025-10-30
- Version: "All Wranglers" -> 4.60.0
- Component: Pages (
wrangler pages dev) - Labels: bug, pages, error-messaging
- Comments: 0
Key Evidence
Referenced Issue #965: The issue references GitHub issue #965, which describes the original bug where
wrangler pages dev -- npm run servefails on PowerShell but works on Command Prompt.Issue #965 Already Fixed: The changelog shows issue #965 was fixed in wrangler 2.0.5+ by making the
commandargument variadic:On Windows, the following command
wrangler pages dev -- foo barwould error saying thatbarwas not a known argument. This is becausefooandbarare passed to Yargs as separate arguments. A workaround is to put the command in quotes:wrangler pages dev -- "foo bar". But this fix makes thecommandargument variadic, which also solves the problem.Current Code Analysis: Reviewing
packages/wrangler/src/pages/dev.ts:- The
-- <command>and--proxyoptions are already deprecated with a clear warning (line 1045):Specifying a `-- <command>` or `--proxy` is deprecated and will be removed in a future version of Wrangler. Build your application to a directory and run the `wrangler pages dev <directory>` instead. This results in a more faithful emulation of production behavior. - The code uses
shell: isWindows()when spawning the proxy process (line 1070), which helps with some Windows-specific issues. - There is no specific PowerShell warning implemented.
- The
Context from Issue #965 Comments:
- petebacondarwin (maintainer) wrote: "This is a known issue on a Pages command that we have deprecated. I think it would be nice to try to tell if you are trying to do this in PowerShell and add a warning. I'll open an issue to add that."
- This issue (#5469) was created as a result of that comment.
Feature is Deprecated: Since the
-- commandand--proxyfeatures are already deprecated and slated for removal, adding a PowerShell-specific warning has questionable value:- The deprecation warning already advises users to migrate away from this pattern
- Any investment in PowerShell detection would be for a deprecated feature
Recommendation
Status: CLOSE
Reasoning: The underlying bug (#965) was fixed in wrangler 2.0.5. Additionally, the -- command and --proxy features are now deprecated with clear warnings advising users to use wrangler pages dev <directory> instead. Adding a PowerShell-specific warning for a deprecated feature that's slated for removal provides minimal value and would require non-trivial effort to detect the shell environment reliably.
Action: Close with comment explaining the status.
Suggested Comment
Thank you for opening this issue. After review:
The original underlying bug (#965) was fixed in wrangler 2.0.5 by making the command argument variadic, which resolves the PowerShell argument parsing issue for most cases.
The
-- <command>and--proxyoptions have since been deprecated and will be removed in a future version of Wrangler. The current deprecation warning already advises users to migrate towrangler pages dev <directory>instead.Given that the feature is deprecated with a clear migration path and the original parsing issue was addressed, we're closing this issue. If you encounter specific issues with the deprecated command pattern, the recommended workaround is to quote the command:
wrangler pages dev -- "npm run serve", or preferably migrate to the non-deprecated approach of building to a directory first.
Notes & Feedback (0)
No notes yet.