React-native-windows: Error when following "Get Started -> With VS Code" directions for Windows: unknown option `--proxy'

Created on 24 Sep 2020  路  3Comments  路  Source: microsoft/react-native-windows

Environment

Run the following in your terminal and copy the results here.

  1. npx react-native --version:
4.13.0
  1. npx react-native run-windows --info:
 System:
    OS: Windows 10 10.0.19041
  Binaries:
    Node: 12.18.4 - C:\Program Files (x86)\nodejs\node.EXE
    Yarn: 1.22.5 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 6.14.8 - C:\Program Files (x86)\nodejs\npm.CMD
  npmPackages:
    react: 16.13.1 => 16.13.1
    react-native: 0.63.2 => 0.63.2
    react-native-windows: ^0.63.0-0 => 0.63.3
  Installed UWP SDKs:
    10.0.17134.0
    10.0.18362.0
  1. reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock"
    AllowDevelopmentWithoutDevLicense    REG_DWORD    0x1
    AllowAllTrustedApps    REG_DWORD    0x1

Steps To Reproduce

Provide a detailed list of steps that reproduce the issue.

  1. Follow "With VS Code" directions to create a new app per:
    https://microsoft.github.io/react-native-windows/docs/getting-started
> npx react-native init testapp --template [email protected].*
> cd testapp
> npx react-native-windows-init --overwrite
  1. add .vscode/launch.json
  2. F5

VS Code debugging works for Android but not Windows. Windows fails with below error.
CLI (npx react-native run-windows) and VS work fine.

Looks like the same problem as this comment but I didn't see an issue for it:

https://github.com/microsoft/react-native-windows/issues/4134#issuecomment-671596103

VS Code terminal output:

React Native tab output:

[Error] Error: Error while executing command 'c:\Users\testuser\Source\Repos\testapp\node_modules\.bin\react-native.cmd run-windows --proxy --no-packager': Error while executing command 'c:\Users\testuser\Source\Repos\testapp\node_modules\.bin\react-native.cmd run-windows --proxy --no-packager' (error code 101)

React Native: Run windows tab output:

[Info] Starting React Native Packager.
[Info] Attaching to running React Native packager
error: unknown option `--proxy'
bug

All 3 comments

The --proxy is coming from the react native extension: https://github.com/microsoft/vscode-react-native/blob/4dfc9ffdec1cdd7d033000fe778fbe6574e31917/src/extension/windows/windowsPlatform.ts#L50

we don't have a --proxy option in our CLI anymore, it's called --remote-debugging now, see this commit:
https://github.com/microsoft/react-native-windows/commit/8f12940f753cee4f1ad8d4da7d9d3a3e755b9241

Filed bug in the extension repo and sent mail to the team.

Looks like the 1.0 release that just dropped has this fix: https://github.com/microsoft/vscode-react-native/releases/tag/1.0.0
Grab that and you should be good.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

syedibrahimt picture syedibrahimt  路  3Comments

fatfatson picture fatfatson  路  3Comments

dubiao picture dubiao  路  3Comments

datkinson picture datkinson  路  3Comments

qmatteoq picture qmatteoq  路  3Comments