microsoft / microsoft/react-native-windows
codegen-windows does not generate .vcxproj, .vcxproj.filters, and stubs
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 17.3k
- Forks
- 1.2k
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 33
Description
Problem Description
Hello! 👋
I'm a beginner looking to get familiar with RNW, and I'm running into a strange issue. Whenever I run react-native codegen-windows in a test project, it only generates the <module-name>Spec.g.h file and a .clang-format file, but there are no C++ stubs and the .vcxproj and .vcxproj.filters are not created. Not sure if this is something I'm doing wrong, but I've tried it in a couple of projects and it doesn't appear to be working.
Steps To Reproduce
- Generate a new project with
npx --yes @react-native-community/cli@latest init Test --version "0.79.0" cdintoTestyarn add react-native-windows@^0.79.0yarn react-native init-windows --template cpp-app --overwrite- Add
NativeTestlib.tsintosrc - Add the the below JSON to
package.json - Run
react-native codegen-windows
JSON added to the package.json:
"codegenConfig": {
"name": "RNTestlibSpec",
"type": "modules",
"jsSrcsDir": "src",
"outputDir": {
"ios": "ios/generated",
"android": "android/generated"
},
"android": {
"javaPackageName": "com.testlib"
},
"includesGeneratedCode": true,
"windows": {
"namespace": "testlibCodegen",
"outputDirectory": "windows/testlib/codegen",
"separateDataTypes": true
}
}
Expected Results
I expect that Codegen would produce the .vcxproj and other files mentioned previously.
CLI version
18.0.0
Environment
System:
OS: Windows 11 10.0.26100
CPU: (24) x64 12th Gen Intel(R) Core(TM) i9-12900KF
Memory: 11.93 GB / 31.84 GB
Binaries:
Node:
version: 22.11.0
path: C:\Program Files\nodejs\node.EXE
Yarn:
version: 1.22.22
path: C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm:
version: 11.1.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.22621.0
- 10.0.26100.0
IDEs:
Android Studio: AI-232.10300.40.2321.11567975
Visual Studio:
- 17.12.35728.132 (Visual Studio Community 2022)
Languages:
Java:
version: 17.0.10
path: C:\Program Files\Microsoft\jdk-17.0.10.7-hotspot\bin\javac.EXE
Ruby: Not Found
npmPackages:
"@react-native-community/cli":
installed: 18.0.0
wanted: 18.0.0
react:
installed: 19.0.0
wanted: 19.0.0
react-native:
installed: 0.79.1
wanted: 0.79.1
react-native-windows:
installed: 0.79.0
wanted: 0.79.0
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: true
newArchEnabled: true
iOS:
hermesEnabled: Not found
newArchEnabled: Not found
Community Modules
None
Target React Native Architecture
New Architecture (WinAppSDK) Only
Target Platform Version
None
Visual Studio Version
Visual Studio 2022
Build Configuration
Debug
Snack, code example, screenshot, or link to a repository
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with the listed React Native Windows setup, the NativeTestlib.ts module, and the package.json codegenConfig, then run react-native codegen-windows. Compare the generated output with the expected .vcxproj, .vcxproj.filters, C++ stubs, .g.h file, and .clang-format file; the work is done when the missing Windows project and stub files are generated.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, react-native, typescript
- Domain
- build-system, cli, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100