Error thrown while debugging windows/WPF based project in VSCode
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:)
- react-native init test
- cd test
- npm install --save-dev rnpm-plugin-windows
- npm install react-native
- react-native wpf
- In VSCode edit launch.json "type": "reactnative", "request": "launch", "platform": "windows"
- react-native run-wpf
- 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"
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.
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
As I mentioned https://github.com/Microsoft/vscode-react-native support only android and ios
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.
@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.
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