reactwg / react-native-releases

React Native Releases Working Group
352 stars 8 forks source link

[0.75] Fix codegen failing in a pnpm monorepo because of missing yargs #436

Closed tido64 closed 1 month ago

tido64 commented 2 months ago

Target Branch(es)

0.75

Link to commit or PR to be picked

https://github.com/facebook/react-native/pull/45995

Description

Android fails to build in a pnpm monorepo setup because yargs cannot be found:

% yarn android
info Installing the app...

> Configure project :app
WARNING: The option setting 'android.jetifier.ignorelist=hermes-android' is experimental.
Signing config for 'release' build type not found; reusing debug config

> Task :react-native-webapis_web-storage:generateCodegenSchemaFromJavaScript FAILED
28 actionable tasks: 6 executed, 22 up-to-date

node:internal/modules/cjs/loader:1148
  throw err;
  ^

Error: Cannot find module 'yargs'
Require stack:
- /~/node_modules/.store/@react-native-codegen-virtual-39ff8dcc54/package/lib/cli/combine/combine-js-to-schema-cli.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1145:15)
    at Module._load (node:internal/modules/cjs/loader:986:27)
    at Module.require (node:internal/modules/cjs/loader:1233:19)
    at require (node:internal/modules/helpers:179:18)
blakef commented 1 month ago

✅ Picked