Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WinUI 3 project template only support C# at the moment? #12063

Closed
lovettchris opened this issue Aug 24, 2023 · 3 comments
Closed

WinUI 3 project template only support C# at the moment? #12063

lovettchris opened this issue Aug 24, 2023 · 3 comments

Comments

@lovettchris
Copy link
Member

lovettchris commented Aug 24, 2023

Problem Description

THis page:
https://microsoft.github.io/react-native-windows/docs/winui3#additional-resources

Seems to imply C++ should work, but when I created a react-native-windows app then tried to apply winui3 template I get this error:

(sr) D:\temp\ReactWinUIApp\ReactWinUIApp>npx react-native-windows-init --useWinUI3 --overwrite --language cpp
Reading project name from package.json...
Reading react-native version from node_modules...
Reading react-native version from node_modules...
Latest matching version of react-native-windows for react-native@0.72.4 is react-native-windows@0.72.7
Installing react-native-windows@0.72.7...
warning ..\..\package.json: No license field
react-native-windows@0.72.7 successfully installed.
Found existing project, extracting ProjectGuid.
Using experimental WinUI3 dependency.
WinUI 3 project template only support C# at the moment
IncompatibleOptions: WinUI 3 project template only support C# at the moment
    at copyProjectTemplateAndReplace (D:\temp\ReactWinUIApp\ReactWinUIApp\node_modules\@react-native-windows\cli\src\generator-windows\index.ts:143:13)
    at generateWindows (D:\temp\ReactWinUIApp\ReactWinUIApp\node_modules\@react-native-windows\cli\src\index.ts:78:38)
    at Object.reactNativeWindowsInit (C:\Users\clovett.REDMOND\AppData\Local\npm-cache\_npx\966c6a96be6f5a32\node_modules\react-native-windows-init\src\Cli.ts:642:5) {
  type: 'IncompatibleOptions',
  data: { detail: 'useWinUI3 and cpp' }
}
Command failed. Re-run the command with --verbose for more information.

Steps To Reproduce

  1. npx react-native init Foo --version "latest"
  2. cd Foo
  3. npx react-native-windows-init --useWinUI3 --overwrite --language cpp

Expected Results

Should work?

CLI version

11.3.6

Environment

info Fetching system and libraries information...
System:
  OS: Windows 10 10.0.22621
  CPU: (20) x64 Intel(R) Core(TM) i9-10900K CPU @ 3.70GHz
  Memory: 41.77 GB / 63.78 GB
Binaries:
  Node:
    version: 18.17.1
    path: C:\Program Files\nodejs\node.EXE
  Yarn:
    version: 1.22.5
    path: C:\Program Files (x86)\Yarn\bin\yarn.CMD
  npm:
    version: 9.8.0
    path: C:\Program Files\nodejs\npm.CMD
  Watchman: Not Found
SDKs:
  Android SDK: Not Found
  Windows SDK:
    AllowDevelopmentWithoutDevLicense: Enabled
    AllowAllTrustedApps: Enabled
    Versions:
      - 10.0.18362.0
      - 10.0.19041.0
      - 10.0.22000.0
      - 10.0.22621.0
IDEs:
  Android Studio: Not Found
  Visual Studio:
    - 17.7.34018.315 (Visual Studio Enterprise 2022)
Languages:
  Java: Not Found
  Ruby: Not Found
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.72.4
    wanted: 0.72.4
  react-native-windows:
    installed: 0.72.7
    wanted: 0.72.7
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

Target Platform Version

10.0.19041

Target Device(s)

Desktop

Visual Studio Version

Visual Studio 2022

Build Configuration

Debug

Snack, code example, screenshot, or link to a repository

No response

@lovettchris lovettchris changed the title Describe the problem WinUI 3 project template only support C# at the moment? Aug 24, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs: Triage 🔍 New issue that needs to be reviewed by the issue management team (label applied by bot) label Aug 24, 2023
@chrisglein
Copy link
Member

I believe we only have C# support implemented for WinUI3. So these docs are incorrect.
Additionally, we're investing in another path that will lead us to hosting WinUI3 content for Fabric, although that's still in active development.

What's your scenario for needing WinUI3? Do you have an existing WinAppSDK app that you're trying to add React Native to?

@chrisglein chrisglein added Documentation Platform: WinAppSDK and removed Needs: Triage 🔍 New issue that needs to be reviewed by the issue management team (label applied by bot) labels Aug 24, 2023
@chrisglein chrisglein added this to the 0.73 milestone Aug 24, 2023
@lovettchris
Copy link
Member Author

I have existing react native UWP app that I want to migrate to WinAppSDK so we can eliminate some of the limitations of UWP (like serving localhost tcp sockets). So even better if there are migration tools instead of starting from scratch...

@jonthysell
Copy link
Contributor

That particular experimental WinUI3 template was deprecated. The new, fabric template will be C++ and WinAppSDK based.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants