microsoft / microsoft/react-native-windows

[Bug] init-windows adds incorrect name of Native Codegen File Include

Open
#15,094 4 comments 2 reactions 3 assignees View on GitHub

@anupriya13 is already working on this.

Since Nov 5, 2025.

  • #15096 by @copilot-swe-agent — merged
Area: CLI bug good first issue
Dominant language
C++
Stars
17.3k
Forks
1.2k
Avg merge
1d 13h
Merged PRs (30d)
33

Description

Problem Description

Run init-windows new arch template command

Steps To Reproduce

Clone react-native-webview
Run init-windows new arch template command
Check the .h boiler code and included native codegen file name

Expected Results

For example in webview .h file, it adds below
#include "codegen/NativeReactNativeWebviewSpec.g.h"
instead the expectation was below
#include "codegen/NativeRNCWebviewModuleSpec.g.h"

Workaround is to manually rename and fix it but ideally the script should support correct naming of include files

Fix init-windows new arch command in codegen that when it creates the boiler .h file it should include the correct nativemodulespec.g.h file name check from path

Image
CLI version

17.0.0

Environment
info Fetching system and libraries information...
System:
  OS: Windows 11 10.0.22631
  CPU: (16) x64 Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz
  Memory: 26.71 GB / 63.95 GB
Binaries:
  Node:
    version: 22.14.0
    path: C:\nvm4w\nodejs\node.EXE
  Yarn:
    version: 1.22.22
    path: C:\Program Files (x86)\Yarn\bin\yarn.CMD
  npm:
    version: 10.9.2
    path: C:\nvm4w\nodejs\npm.CMD
  Watchman: Not Found
SDKs:
  Android SDK: Not Found
  Windows SDK:
    AllowDevelopmentWithoutDevLicense: Enabled
    AllowAllTrustedApps: Enabled
    Versions:
      - 10.0.17763.0
      - 10.0.19041.0
      - 10.0.22621.0
      - 10.0.26100.0
IDEs:
  Android Studio: Not Found
  Visual Studio:
    - 17.14.36408.4 (Visual Studio Enterprise 2022)
    - 17.14.36408.4 (Visual Studio Community 2022)
Languages:
  Java: Not Found
  Ruby: 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
Android:
  hermesEnabled: Not found
  newArchEnabled: Not found
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found
Community Modules

react-native-webview

Target React Native Architecture

None

Target Platform Version

None

Visual Studio Version

None

Build Configuration

None

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

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.