workers-sdk: 🐛 BUG: `wrangler pages dev -- npm run serve` gives an "Unknown argument" error

What version of Wrangler are you using?

2.0.2

What operating system are you using?

Windows

Describe the Bug

I am currently giving WebStorm a try and I am encountering a problem when running the command below: wrangler pages dev --proxy 8080 -- npm run serve

Indeed, when this command is executed via a classic Command Prompt, everything works fine, but when it is executed from PowerShell, the following error is displayed: error

The command npm run serve works correctly.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 29 (16 by maintainers)

Commits related to this issue

Most upvoted comments

I am not sure why the behaviour is different between command prompts. I guess different prompts pass the args in in different ways at the OS level?? Anyway, my PR (#1057) should be a reliable fix across all, and is arguably the right way to do this anyway.

  • npx wrangler pages dev --proxy 8080 -- npm run serve

I just tried starting wrangler with npx, and the command works just fine when doing so. The command only fails when running wrangler using the wrangler command.

Can confirm this is a bug since I am also having the same issue.

Using wrangler@2.0.3 and:

  • getting the exact same error when running the same command on PowerShell@7.2.2
  • getting no error when using the Command Prompt or Git Bash

I have this problem when I try to run the command just after cloning this project (so you can try by yourself): https://github.com/Flotss/maxouxax.me