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

[0.74] Fix codegen failing in a pnpm monorepo setup #435

Open
tido64 opened this issue Aug 15, 2024 · 0 comments
Open

[0.74] Fix codegen failing in a pnpm monorepo setup #435

tido64 opened this issue Aug 15, 2024 · 0 comments

Comments

@tido64
Copy link
Collaborator

tido64 commented Aug 15, 2024

Target Branch(es)

0.74

Link to commit or PR to be picked

facebook/react-native#45993

Description

pod install in a pnpm monorepo setup using latest 0.74 fails due to missing glob

% pod install --project-directory=ios
Framework build type is static library
[Codegen] Adding script_phases to React-Codegen.
[Codegen] Generating ios/build/generated/ios/React-Codegen.podspec.json

[!] Invalid `Podfile` file: [!] ~/.local/bin/node ios/../node_modules/react-native/scripts/generate-codegen-artifacts.js -p /~/packages/test-app -o /~/packages/test-app/ios -t ios

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

Error: Cannot find module 'glob'
Require stack:
- /~/node_modules/.store/react-native-virtual-424e699e97/package/scripts/codegen/generate-artifacts-executor.js
- /~/node_modules/.store/react-native-virtual-424e699e97/package/scripts/generate-codegen-artifacts.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)
    at Object.<anonymous> (/~/node_modules/.store/react-native-virtual-424e699e97/package/scripts/codegen/generate-artifacts-executor.js:23:14)

Additionally, when building on Android, 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

info 💡 Tip: Make sure that you have set up your development environment correctly, by running npx react-native doctor. To read more about doctor command visit: https://github.com/react-native-community/cli/blob/main/packages/cli-doctor/README.md#doctor

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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Inbox
Development

No branches or pull requests

1 participant