-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
RNGP - findPackageJsonFile
should return null
if package.json
does not exist
#35566
Conversation
cc @Titozzz |
Base commit: 56b10a8 |
Thanks for doing this @tido64
Making this function return |
Base commit: 56b10a8 |
@cortinico has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
This pull request was successfully merged by @tido64 in 913ebd2. When will my fix make it into a release? | Upcoming Releases |
…oes not exist (#35566) Summary: `findPackageJsonFile` always returns a path even though `package.json` does not exist. This causes issues in libraries whose repo setups look like: ``` react-native-webview ├── android │ └── build.gradle ├── example <-- Note the lack of `package.json` here │ └── App.tsx ├── ios │ └── RNCWebView.xcodeproj ├── macos │ └── RNCWebView.xcodeproj ├── package.json └── src ``` When `newArchEnabled=true`, running `yarn android` will fail with the following: ``` FAILURE: Build failed with an exception. * What went wrong: Could not determine the dependencies of task ':app:generateCodegenArtifactsFromSchema'. > Could not create task ':app:generateCodegenSchemaFromJavaScript'. > /~/react-native-webview/example/package.json (No such file or directory) ``` ## Changelog [Android] [Fixed] - `findPackageJsonFile` should return `null` if `package.json` does not exist Pull Request resolved: #35566 Test Plan: ``` git clone https://github.com/react-native-webview/react-native-webview.git cd react-native-webview git checkout new-arch-ios yarn cd example/android ./gradlew clean assembleDebug ``` Reviewed By: NickGerleman Differential Revision: D41739176 Pulled By: cortinico fbshipit-source-id: cab0f1f717db160df244c9bb2769e345d6e19917
…oes not exist (facebook#35566) Summary: `findPackageJsonFile` always returns a path even though `package.json` does not exist. This causes issues in libraries whose repo setups look like: ``` react-native-webview ├── android │ └── build.gradle ├── example <-- Note the lack of `package.json` here │ └── App.tsx ├── ios │ └── RNCWebView.xcodeproj ├── macos │ └── RNCWebView.xcodeproj ├── package.json └── src ``` When `newArchEnabled=true`, running `yarn android` will fail with the following: ``` FAILURE: Build failed with an exception. * What went wrong: Could not determine the dependencies of task ':app:generateCodegenArtifactsFromSchema'. > Could not create task ':app:generateCodegenSchemaFromJavaScript'. > /~/react-native-webview/example/package.json (No such file or directory) ``` ## Changelog [Android] [Fixed] - `findPackageJsonFile` should return `null` if `package.json` does not exist Pull Request resolved: facebook#35566 Test Plan: ``` git clone https://github.com/react-native-webview/react-native-webview.git cd react-native-webview git checkout new-arch-ios yarn cd example/android ./gradlew clean assembleDebug ``` Reviewed By: NickGerleman Differential Revision: D41739176 Pulled By: cortinico fbshipit-source-id: cab0f1f717db160df244c9bb2769e345d6e19917
Summary
findPackageJsonFile
always returns a path even thoughpackage.json
does not exist. This causes issues in libraries whose repo setups look like:When
newArchEnabled=true
, runningyarn android
will fail with the following:Changelog
[Android] [Fixed] -
findPackageJsonFile
should returnnull
ifpackage.json
does not existTest Plan