react-native-windows icon indicating copy to clipboard operation
react-native-windows copied to clipboard

Error thrown while debugging windows/WPF based project in VSCode

Open praveen4zenith opened this issue 8 years ago • 6 comments

Environment

react-native -v: react-native-cli: 2.0.1 react-native: 0.55.4

npm ls rnpm-plugin-windows: [email protected]

npm ls react-native-windows: [email protected]

node -v: v6.11.1

npm -v: 3.10.10

yarn --version:

Then, specify:

Target Platform: WPF Target Platform Version(s): .NET 4.6.0 WPF Target Device(s): Desktop Development Operating System: Windows 10 Pro version: 1709 Visual Studio Version: 2017

Steps to Reproduce

(Write your steps here:)

  1. react-native init test
  2. cd test
  3. npm install --save-dev rnpm-plugin-windows
  4. npm install react-native
  5. react-native wpf
  6. In VSCode edit launch.json "type": "reactnative", "request": "launch", "platform": "windows"
  7. react-native run-wpf 
  8. Error thrown: "windows is not a valid platform"

Expected Behavior

Should be able to debug windows/wpf code in VSCode using breakpoints

Actual Behavior

On debugging code in VScode with platform as 'windows' in launch.json below error thrown: "windows is not a valid platform"

praveen4zenith avatar Jun 04 '18 18:06 praveen4zenith

Why are you doing step 6? I don't see that step listed anywhere in the documentation, and I don't have that file anywhere in my project.

themeadery avatar Jun 08 '18 08:06 themeadery

Please note that I am talking about debugging the code and not simply running the code.

Also I have experience in adding support for type script in VSCode so I am familiar with the requirements. It is required to add a debug configuration for each of the debug variants and this is done by editing launch.json file.

Now talking about react-native below is sample launch.json : https://github.com/Microsoft/vscode-react-native/blob/master/SampleApplication/.vscode/launch.json

For more details how to setup debugging environment : https://github.com/Microsoft/vscode-react-native

praveen4zenith avatar Jun 08 '18 08:06 praveen4zenith

As I mentioned https://github.com/Microsoft/vscode-react-native support only android and ios

praveen4zenith avatar Jun 08 '18 08:06 praveen4zenith

Ah, I see what you mean now and what you are trying to do.

I'm sure you have seen this warning in the react-native-windows documentation: "Note: Development on React Native Windows itself currently requires Visual Studio 2017. It is not supported with VS Code, but we will gladly accept pull requests to enable a great developer experience in those environments."

Hence the extension for VSCode that you are trying to use! However, I think your issue should be created over on that GitHub repository instead of this one. Maybe you will get a better response. Probably different people working on the different projects.

I actually love that you found the extension to add support to VSCode. Now I am going to play with it and try to get it working for my Windows project. The full Visual Studio is too much for me and Notepad++ is just not cutting it.

themeadery avatar Jun 12 '18 16:06 themeadery

@phorensic Yes actually I use Visual Studio for Native Part of react and VSCode for Server/NodeJS part of code. Is it possible to use Visual Studio to debug React-Native code ? Can you provide any reference ? Till now i am managing to debug using console logs and use debuggerui.js.

praveen4zenith avatar Jun 12 '18 16:06 praveen4zenith

I have already logged an issue with the respective plugin developers and one can track its progress below: https://github.com/Microsoft/vscode-react-native/issues/719#issuecomment-395773872

praveen4zenith avatar Jun 12 '18 16:06 praveen4zenith