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

Unable to create a new React Native Windows project #14121

Open
priya-murthy opened this issue Nov 19, 2024 · 4 comments
Open

Unable to create a new React Native Windows project #14121

priya-murthy opened this issue Nov 19, 2024 · 4 comments
Labels
bug Developer First Experience Issues that are going to be hit by a new developer as they first try out RNW Needs: Attention 👋 An issue that had been tagged "Needs: Author Feedback" has received activity (label applied by bot)
Milestone

Comments

@priya-murthy
Copy link

priya-murthy commented Nov 19, 2024

Problem Description

I am trying to create a new React Native Windows project, following the instructions here: https://microsoft.github.io/react-native-windows/docs/getting-started

However, the Microsoft.Windows.CppWinRT package is not being loaded, so the project is not able to be built.

I have noticed that the Boost package is also not being imported, leading to errors about Boost source files not being found (this occurs in the Common, Folly and ReactCommon projects).

I have attached the build log here. BuildLog.txt

Steps To Reproduce

  1. npx --yes @react-native-community/cli@latest init reactsample --version "latest"
  2. cd reactsample
  3. yarn add react-native-windows@^0.76.0
  4. npx react-native init-windows --overwrite
  5. npx react-native autolink-windows
  6. Open Visual Studio and build the solution

Expected Results

No response

CLI version

15.0.1

Environment

info Fetching system and libraries information...
System:
  OS: Windows 11 10.0.22621
  CPU: (16) x64 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz
  Memory: 13.08 GB / 31.21 GB
Binaries:
  Node:
    version: 18.20.4
    path: C:\Program Files\nodejs\node.EXE
  Yarn:
    version: 1.22.22
    path: C:\Program Files (x86)\Yarn\bin\yarn.CMD
  npm:
    version: 10.7.0
    path: C:\Program Files\nodejs\npm.CMD
  Watchman: Not Found
SDKs:
  Android SDK: Not Found
  Windows SDK:
    AllowDevelopmentWithoutDevLicense: Enabled
    Versions:
      - 10.0.18362.0
      - 10.0.19041.0
      - 10.0.20348.0
      - 10.0.22000.0
      - 10.0.22621.0
      - 10.0.26100.0
IDEs:
  Android Studio: Not Found
  Visual Studio:
    - 17.12.35506.116 (Visual Studio Professional 2022)
    - 15.9.35229.15 (Visual Studio Professional 2017)
    - 16.11.35229.62 (Visual Studio Professional 2019)
Languages:
  Java: Not Found
  Ruby: Not Found
npmPackages:
  "@react-native-community/cli":
    installed: 15.0.1
    wanted: 15.0.1
  react:
    installed: 18.3.1
    wanted: 18.3.1
  react-native:
    installed: 0.76.2
    wanted: 0.76.2
  react-native-windows:
    installed: 0.76.0
    wanted: ^0.76.0
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

Community Modules

No response

Target Platform Version

10.0.22621

Target Device(s)

Desktop

Visual Studio Version

Visual Studio 2022

Build Configuration

Debug

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

No response

Copy link

We've found some similar issues:

If any of the above are duplicates, please consider closing this issue out and adding additional context in the original issue.

Note: You can give me feedback by 👍 or 👎 this comment.

@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 Nov 19, 2024
@chrisglein chrisglein added this to the 0.76 milestone Nov 20, 2024
@chrisglein chrisglein added the Developer First Experience Issues that are going to be hit by a new developer as they first try out RNW label Nov 20, 2024
@chrisglein
Copy link
Member

Can you try building from the command line and see if that works?
npx react-native run-windows

We're curious if the nugets aren't getting restored, and the command line steps might work better for that. Regardless let us know (in case the Visual Studio nuget restore needs to be fixed)

@chrisglein chrisglein added Needs: Author Feedback The issue/PR needs activity from its author (label drives bot activity) and removed Needs: Triage 🔍 New issue that needs to be reviewed by the issue management team (label applied by bot) labels Nov 21, 2024
@rasane
Copy link

rasane commented Nov 22, 2024

hi, I am a colleague of the reporter. @priya-murthy is away and will be back next week. Just want to move this forward in the meanwhile. We have tried several things for many days

  • create new projects (use different cli options, versions)
  • command line builds, visual studio 2022 IDE based builds
  • clean nuget caches and retry - nuget caches come back during build process, but same errors
  • uninstall visual studio 2022, reinstall - same errors
  • comparison with a working instance and non-working instance of detailed build logs showcased the peculiarities @priya-murthy mentioned the Microsoft.Windows.CppWinRT package is not being loaded and Boost package is also not being imported
    • Whereas in the working instance, a reference to Microsoft.Windows.CppWinRT does happen in the detailed build log from inside the nuget cache folder, in the non-working scenario, the folder is present automatically after clean, but no reference occurs
    • we notice that the compiler (CL.exe) error reported on node-modules\react-native-windows\Common\Utilities.cpp has missing references to boost library which is present in the nuget cache folder. (we tried manually providing this in project additional include references, but it just errors somewhere else, implying some previous step is missed out)

After a few days of trying different things, we were hoping you could help. The build log @priya-murthy shared has details that we don't understand.

  • The missing piece of knowledge that could allow us to debug could be how are these Nuget cache folder native references added from the node_module folders projects - to narrow down differences.

Version of all Visual Studio 2022 software components was latest.

thanks for your help

@priya-murthy
Copy link
Author

As mentioned above by my colleague, @rasane, we have tried building via the command line and also using Visual Studio, but have had no luck.

Please advise as to how we can proceed.

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs: Attention 👋 An issue that had been tagged "Needs: Author Feedback" has received activity (label applied by bot) and removed Needs: Author Feedback The issue/PR needs activity from its author (label drives bot activity) labels Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Developer First Experience Issues that are going to be hit by a new developer as they first try out RNW Needs: Attention 👋 An issue that had been tagged "Needs: Author Feedback" has received activity (label applied by bot)
Projects
None yet
Development

No branches or pull requests

3 participants