Open NickGerleman opened 4 years ago
Project generator would need to navigate the yarn lookup to find wherever it actually is. Think the result would still be static (can't have the SLN file do the dynamic lookup).
My monorepo project structure is: myproject/ | package.json (main monorepo config) includes "workspaces": { "packages": [ "packages/*" ], "nohoist": [ "/react-native-windows", "/react-native-windows/**" ] }, /packages /mobile | package.json (monorepo config(dirname)) "react-native-windows": "^0.63.0-0","react-native": "0.63.2", "shared": "0.0.1", | metro.config | android | ios | windows
/shared
C:\rnWindows\packages\mobile\node_modules\react-native-windows\ReactCommon\ReactCommon.vcxproj : error : The project file could not be loaded. Could not find a part of the path 'C:\rnWindows\packages\mobile\node_modules\react-native-windows\ReactCommon\ReactCommon.vcxproj'. C:\rnWindows\packages\mobile\node_modules\react-native-windows\ReactCommon\ReactCommon.vcxproj
C:\rnWindows\packages\mobile\node_modules\react-native-windows\Chakra\Chakra.vcxitems : error : Project "C:\rnWindows\packages\mobile\node_modules\react-native-windows\Chakra\Chakra.vcxitems" could not be found.
C:\rnWindows\packages\mobile\node_modules\react-native-windows\Microsoft.ReactNative\Microsoft.ReactNative.vcxproj : error : The project file could not be loaded. Could not find a part of the path 'C:\rnWindows\packages\mobile\node_modules\react-native-windows\Microsoft.ReactNative\Microsoft.ReactNative.vcxproj'. C:\rnWindows\packages\mobile\node_modules\react-native-windows\Microsoft.ReactNative\Microsoft.ReactNative.vcxproj
C:\rnWindows\packages\mobile\node_modules\react-native-windows\JSI\Shared\JSI.Shared.vcxitems : error : Project "C:\rnWindows\packages\mobile\node_modules\react-native-windows\JSI\Shared\JSI.Shared.vcxitems" could not be found.
C:\rnWindows\packages\mobile\node_modules\react-native-windows\JSI\Universal\JSI.Universal.vcxproj : error : The project file could not be loaded. Could not find a part of the path 'C:\rnWindows\packages\mobile\node_modules\react-native-windows\JSI\Universal\JSI.Universal.vcxproj'. C:\rnWindows\packages\mobile\node_modules\react-native-windows\JSI\Universal\JSI.Universal.vcxproj
C:\rnWindows\packages\mobile\node_modules\react-native-windows\Microsoft.ReactNative.Cxx\Microsoft.ReactNative.Cxx.vcxitems : error : Project "C:\rnWindows\packages\mobile\node_modules\react-native-windows\Microsoft.ReactNative.Cxx\Microsoft.ReactNative.Cxx.vcxitems" could not be found.
C:\rnWindows\packages\mobile\node_modules\react-native-windows\Common\Common.vcxproj : error : The project file could not be loaded. Could not find a part of the path 'C:\rnWindows\packages\mobile\node_modules\react-native-windows\Common\Common.vcxproj'. C:\rnWindows\packages\mobile\node_modules\react-native-windows\Common\Common.vcxproj
C:\rnWindows\packages\mobile\node_modules\react-native-windows\Folly\Folly.vcxproj : error : The project file could not be loaded. Could not find a part of the path 'C:\rnWindows\packages\mobile\node_modules\react-native-windows\Folly\Folly.vcxproj'. C:\rnWindows\packages\mobile\node_modules\react-native-windows\Folly\Folly.vcxproj
C:\rnWindows\packages\mobile\node_modules\react-native-windows\Shared\Shared.vcxitems : error : Project "C:\rnWindows\packages\mobile\node_modules\react-native-windows\Shared\Shared.vcxitems" could not be found.
C:\rnWindows\packages\mobile\node_modules\react-native-windows\Mso\Mso.vcxitems : error : Project "C:\rnWindows\packages\mobile\node_modules\react-native-windows\Mso\Mso.vcxitems" could not be found.
C:\rnWindows\packages\mobile\node_modules\react-native-windows\include\Include.vcxitems : error : Project "C:\rnWindows\packages\mobile\node_modules\react-native-windows\include\Include.vcxitems" could not be found.
C:\rnWindows\packages\mobile\node_modules\react-native-windows\Microsoft.ReactNative.Managed\Microsoft.ReactNative.Managed.csproj : error : The project file could not be loaded. Could not find a part of the path 'C:\rnWindows\packages\mobile\node_modules\react-native-windows\Microsoft.ReactNative.Managed\Microsoft.ReactNative.Managed.csproj'. C:\rnWindows\packages\mobile\node_modules\react-native-windows\Microsoft.ReactNative.Managed\Microsoft.ReactNative.Managed.csproj
C:\rnWindows\packages\mobile\node_modules\react-native-windows\Microsoft.ReactNative.Managed.CodeGen\Microsoft.ReactNative.Managed.CodeGen.csproj : error : The project file cannot be found.
error : Designtime build failed for project 'C:\rnWindows\packages\mobile\windows\mobile\mobile.vcxproj' configuration 'Debug|ARM'. IntelliSense might be unavailable.
Set environment variable TRACEDESIGNTIME = true and restart Visual Studio to investigate.
npx react-native --version: 4.13.0
npx react-native run-windows --info:
System:
OS: Windows 10 10.0.17763
CPU: (12) x64 Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz
Memory: 2.07 GB / 15.87 GB
Binaries:
Node: 12.2.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.4 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.9.0 - C:\Program Files\nodejs\npm.CMD
npmPackages:
react: 16.13.1 => 16.13.1
react-native: 0.63.2 => 0.63.2
react-native-windows: ^0.63.0-0 => 0.63.3
Installed UWP SDKs:
10.0.14393.0
10.0.17763.0
10.0.18362.0
react-native-cli: 2.0.1
react-native: 0.63.2
npm ls rnpm-plugin-windows: mobile@0.0.1 C:\repos\....\......UI\packages\mobile
yarn --version : 1.22.4
node -v : v12.2.0
npm -v: 6.9.0
Does anyone have a workaround for this? I'd love to use RNW but our project is in a monorepo (with the main 'binary' under /apps/expo), and the generated *.sln is still looking for files one level up instead of at the root of the repository.
You can certainly manually edit the sln file to provide the appropriate paths to the project files.
MyApp.sln
hard-codes the path to node_modules\react-native-windows. This path is often not correct, such as when used in monorepos. In this case, the solution will not correctly load.