[msvc] react-native-windows failed with warning C4864: expected 'template' keyword before dependent template name

Author: PhoebeHuiCreated Jul 22, 2026Updated Aug 24, 2026
LabelsbugNeeds: Triage :mag:

Problem Description

When build react-native-windows with VS2026 on windows, it failed with 'warning C4864: expected 'template' keyword before dependent template name', could you please take a look?

Failures:

C:\gitP\microsoft\react-native-windows\vnext\Microsoft.ReactNative\Fabric\Composition\CompositionContextHelper.cpp(1799,52): error C2220: the following warning is treated as an error [C:\gitP\microsoft\react-native-windows\vnext\Desktop\React.Windows.Desktop.vcxproj]
         (compiling source file '../Microsoft.ReactNative/Fabric/Composition/CompositionContextHelper.cpp')
         
C:\gitP\microsoft\react-native-windows\vnext\Microsoft.ReactNative\Fabric\Composition\CompositionContextHelper.cpp(1799,52): warning C4864: expected 'template' keyword before dependent template name [C:\gitP\microsoft\react-native-windows\vnext\Desktop\React.Windows.Desktop.vcxproj]

Steps To Reproduce

  1. git clone https://github.com/microsoft/react-native-windows and checkout 883b2f4
  2. cd /d C:\gitP\microsoft\react-native-windows
  3. msbuild /m /restore /p:PlatformToolset=v145 /p:Platform=x64 /p:Configuration=Release /p:WindowsTargetPlatformVersion=10.0.26100.0 /p:PublishToolDuringBuild=true /p:RestoreLockedMode=true /p:RestoreForceEvaluate=true /p:VisualStudioVersion="18.0" vnext\ReactWindows-Desktop.sln /t:Rebuild

Expected Results

It builds successfully.

CLI version

20.0.0

Environment

markdown
nfo Fetching system and libraries information...
System:
  OS: Windows 11 10.0.26200
  CPU: (16) x64 Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz
  Memory: 48.74 GB / 63.95 GB
Binaries:
  Node:
    version: 20.19.4
    path: C:\Program Files\nodejs\node.EXE
  Yarn:
    version: 4.13.0
    path: C:\Program Files (x86)\Yarn\bin\yarn.CMD
  npm:
    version: 10.8.2
    path: C:\Program Files\nodejs\npm.CMD
  Watchman: Not Found
SDKs:
  Android SDK: Not Found
  Windows SDK: Not Found
IDEs:
  Android Studio: Not Found
  Visual Studio:
    - 18.7.12002.237 (Visual Studio Enterprise 2026)
Languages:
  Java: Not Found
  Ruby:
    version: 3.1.3
    path: C:\tools\ruby31\bin\ruby.EXE
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 19.2.3
    wanted: 19.2.3
  react-native:
    installed: 0.85.0-nightly-20260303-c26dbe286
    wanted: 0.85.0-nightly-20260303-c26dbe286
  react-native-windows: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: Not found
  newArchEnabled: Not found
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

Community Modules

No response

Target React Native Architecture

None

Target Platform Version

amd64

Visual Studio Version

2026

Build Configuration

x64, Release

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

No response

Source: microsoft/react-native-windows