microsoft / react-native-xaml

A React Native Windows library to use XAML / WinUI controls
MIT License
93 stars 25 forks source link

Build error in example/windows/example.sln with Microsoft.ReactNative, 'Mso::MustBeNoExceptVoidFunctor: not a noexcept callable functor returning void' #229

Closed ChrisGuzak closed 1 year ago

ChrisGuzak commented 1 year ago

Problem Description

5>------ Build started: Project: Microsoft.ReactNative, Configuration: Debug x64 ------ 5>C:\Users\chrisg.NTDEV\source\repos\react-native-xaml\node_modules\react-native-windows\Mso\dispatchQueue\dispatchQueue.h(728,17): error C2338: static_assert failed: 'Mso::MustBeNoExceptVoidFunctor: not a noexcept callable functor returning void' 5>C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\XamlCompiler\Microsoft.Windows.UI.Xaml.Common.targets(486,5): error MSB4181: The "CompileXaml" task returned false but did not log an error.

Steps To Reproduce

  1. clone the repo, follow the directions to enable building (run yarn, etc.)
  2. open the example\windows\example.sln
  3. choose debug/x64 configuration
  4. project.build

this is compiling pch\pch.cpp

Note, I upgraded the toolset to v143, but I saw the same error when I tried to build with v140 so don't think this is specific to the toolset.

Expected Results

build works

Environment

npx react-native info
Get-ChildItem : Cannot find path 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise C:\Program Files
(x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\Extensions\' because it does not exist.
At C:\Users\chrisg.NTDEV\source\repos\react-native-xaml\node_modules\react-native-windows\Scripts\rnw-dependencies.ps1:
174 char:19
+ ...   $natvis = Get-ChildItem "$vsPath\Common7\IDE\Extensions\cppwinrt.na ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\Program File...IDE\Extensions\:String) [Get-ChildItem], ItemNotFound
   Exception
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand

info Fetching system and libraries information...
System:
    OS: Windows 10 10.0.22621
    CPU: (12) x64 Intel(R) Xeon(R) W-2133 CPU @ 3.60GHz
    Memory: 8.94 GB / 31.73 GB
  Binaries:
    Node: 16.14.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 8.3.1 - 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
  IDEs:
    Android Studio: Not Found
    Visual Studio: 17.3.32929.385 (Visual Studio Enterprise 2022), 16.11.32929.386 (Visual Studio Enterprise 2019)
  Languages:
    Java: Not Found
  npmPackages:
    @react-native-community/cli: Not Found
    react: Not Found
    react-native: Not Found
    react-native-windows: Not Found
  npmGlobalPackages:
    *react-native*: Not Found
asklar commented 1 year ago

this is an RNW bug that has already been fixed https://github.com/microsoft/react-native-windows/issues/9559 so the project needs to update to a newer version of RNW

ChrisGuzak commented 1 year ago

@asklar thanks! how do I update to the newer RNW? is that something I should try?

ChrisGuzak commented 1 year ago

I updated the title. this is in the example in this project. example/windows/example.sln