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

Generator Will Create an Invalid Solution For Monorepo Projects #5933

Open
NickGerleman opened this issue Sep 7, 2020 · 4 comments
Open
Labels
Area: Build Infrastructure Area: Developer Experience Area: Infrastructure bug Workstream: ES Compliance SFI Provide regular ES infrastructure and ensur RNW meets internal security and compliance requirements.
Milestone

Comments

@NickGerleman
Copy link
Collaborator

NickGerleman commented Sep 7, 2020

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.

	GlobalSection(SharedMSBuildProjectFiles) = preSolution
		..\node_modules\react-native-windows\JSI\Shared\JSI.Shared.vcxitems*{0cc28589-39e4-4288-b162-97b959f8b843}*SharedItemsImports = 9
		..\node_modules\react-native-windows\Shared\Shared.vcxitems*{2049dbe9-8d13-42c9-ae4b-413ae38fffd0}*SharedItemsImports = 9
		..\node_modules\react-native-windows\Mso\Mso.vcxitems*{84e05bfa-cbaf-4f0d-bfb6-4ce85742a57e}*SharedItemsImports = 9
		..\node_modules\react-native-windows\JSI\Shared\JSI.Shared.vcxitems*{a62d504a-16b8-41d2-9f19-e2e86019e5e4}*SharedItemsImports = 4
		..\node_modules\react-native-windows\Chakra\Chakra.vcxitems*{c38970c0-5fbf-4d69-90d8-cbac225ae895}*SharedItemsImports = 9
		..\node_modules\react-native-windows\Microsoft.ReactNative.Cxx\Microsoft.ReactNative.Cxx.vcxitems*{da8b35b3-da00-4b02-bde6-6a397b3fd46b}*SharedItemsImports = 9
		..\node_modules\react-native-windows\include\Include.vcxitems*{ef074ba1-2d54-4d49-a28e-5e040b47cd2e}*SharedItemsImports = 9
		..\node_modules\react-native-windows\Chakra\Chakra.vcxitems*{f7d32bd0-2749-483e-9a0d-1635ef7e3136}*SharedItemsImports = 4
		..\node_modules\react-native-windows\Microsoft.ReactNative.Cxx\Microsoft.ReactNative.Cxx.vcxitems*{f7d32bd0-2749-483e-9a0d-1635ef7e3136}*SharedItemsImports = 4
		..\node_modules\react-native-windows\Mso\Mso.vcxitems*{f7d32bd0-2749-483e-9a0d-1635ef7e3136}*SharedItemsImports = 4
		..\node_modules\react-native-windows\Shared\Shared.vcxitems*{f7d32bd0-2749-483e-9a0d-1635ef7e3136}*SharedItemsImports = 4
	EndGlobalSection
@ghost ghost added the Needs: Triage 🔍 New issue that needs to be reviewed by the issue management team (label applied by bot) label Sep 7, 2020
@chrisglein
Copy link
Member

chrisglein commented Sep 8, 2020

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).

@chrisglein chrisglein added Area: Build Infrastructure Area: Infrastructure and removed Needs: Triage 🔍 New issue that needs to be reviewed by the issue management team (label applied by bot) labels Sep 8, 2020
@chrisglein chrisglein added this to the Backlog milestone Sep 8, 2020
@ghost ghost added the Invalid Triage https://github.com/microsoft/react-native-windows/wiki/Triage-Process (label applied by bot) label Sep 15, 2020
@chrisglein chrisglein added bug and removed Invalid Triage https://github.com/microsoft/react-native-windows/wiki/Triage-Process (label applied by bot) labels Sep 18, 2020
@ugrylmz
Copy link

ugrylmz commented Oct 1, 2020

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: [email protected] C:\repos\....\......UI\packages\mobile
yarn --version : 1.22.4
node -v : v12.2.0
npm -v: 6.9.0

@zzorba
Copy link

zzorba commented Sep 30, 2024

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.

@acoates-ms
Copy link
Contributor

You can certainly manually edit the sln file to provide the appropriate paths to the project files.

@chiaramooney chiaramooney added the Workstream: ES Compliance SFI Provide regular ES infrastructure and ensur RNW meets internal security and compliance requirements. label Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Build Infrastructure Area: Developer Experience Area: Infrastructure bug Workstream: ES Compliance SFI Provide regular ES infrastructure and ensur RNW meets internal security and compliance requirements.
Projects
None yet
Development

No branches or pull requests

6 participants