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

Yarn Prepare failure #676

Closed
1 of 2 tasks
bmahajanZ opened this issue Nov 6, 2024 · 7 comments
Closed
1 of 2 tasks

Yarn Prepare failure #676

bmahajanZ opened this issue Nov 6, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@bmahajanZ
Copy link

bmahajanZ commented Nov 6, 2024

Description

As mentioned here - facebook/react-native#47353 (comment), opening a new bug

Packages

  • create-react-native-library
  • react-native-builder-bob

Selected options

npx create-react-native-library@latest

Link to repro

https://github.com/mbhaskar98/test-library

Environment

❯ npx react-native info

⚠️ react-native depends on @react-native-community/cli for cli commands. To fix update your package.json to include:


  "devDependencies": {
    "@react-native-community/cli": "latest",
  }




/test-library  on main +52 ?4 ──────────────────── at 15:26:23 
❯ npx @react-native-community/cli@latest info                             
info Fetching system and libraries information...
System:
  OS: macOS 14.7
  CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
  Memory: 83.04 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.11.1
    path: ~/.nvm/versions/node/v20.11.1/bin/node
  Yarn:
    version: 3.6.1
    path: ~/.nvm/versions/node/v20.11.1/bin/yarn
  npm:
    version: 10.2.4
    path: ~/.nvm/versions/node/v20.11.1/bin/npm
  Watchman:
    version: 2024.06.10.00
    path: /usr/local/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /Users/bhaskarmahajan/.rbenv/shims/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.5
      - iOS 17.5
      - macOS 14.5
      - tvOS 17.5
      - visionOS 1.2
      - watchOS 10.5
  Android SDK: Not Found
IDEs:
  Android Studio: 2024.2 AI-242.23339.11.2421.12483815
  Xcode:
    version: 15.4/15F31d
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 21.0.2
    path: /usr/bin/javac
  Ruby:
    version: 3.3.3
    path: /Users/bhaskarmahajan/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.3.1
    wanted: 18.3.1
  react-native:
    installed: 0.76.1
    wanted: 0.76.1
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: Not found
  newArchEnabled: Not found
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found


 /test-library  on main +52 ?4 ────────── took 8s  at 15:27:58 
❯
@bmahajanZ bmahajanZ added the bug Something isn't working label Nov 6, 2024
@atlj
Copy link
Collaborator

atlj commented Nov 8, 2024

Hey looks like your repository might be a bit old. We've shipped a fix with #665 since then. Could you try to create a library again with the latest version of create-react-native-library@latest and let us know? Closing the issue for now, feel free to ping me if you still have the issue!

@atlj atlj closed this as completed Nov 8, 2024
@bmahajanZ
Copy link
Author

bmahajanZ commented Nov 10, 2024

@atlj the issue still exists. Updated code pushed to https://github.com/mbhaskar98/test-library. New library was created using npx create-react-native-library@latest.

❯ yarn prepare
ℹ Building target codegen
ℹ Building target commonjs
ℹ Cleaning up previous build at lib/commonjs
ℹ Building target module
ℹ Cleaning up previous build at lib/module
ℹ Building target typescript
ℹ Cleaning up previous build at lib/typescript
ℹ Cleaning up previous iOS codegen native code at ios/generated
ℹ Cleaning up previous Android codegen native code at android/generated
ℹ Compiling 2 files in src with babel
ℹ Compiling 2 files in src with babel
ℹ Generating type definitions with tsc
✔ Wrote files to lib/commonjs
✔ Wrote files to lib/module
✔ Wrote definition files to lib/typescript
✖ 
/test-library/node_modules/react-native-builder-bob/lib/targets/codegen.js:48
    throw new Error('Failed generate the codegen files.');
          ^

Error: Failed generate the codegen files.
    at build (/test-library/node_modules/react-native-builder-bob/lib/targets/codegen.js:48:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async buildTarget (/test-library/node_modules/react-native-builder-bob/lib/index.js:425:7)

Node.js v20.11.1
"devDependencies": {
    "@commitlint/config-conventional": "^17.0.2",
    "@evilmartians/lefthook": "^1.5.0",
    "@react-native/eslint-config": "^0.73.1",
    "@release-it/conventional-changelog": "^9.0.2",
    "@types/jest": "^29.5.5",
    "@types/react": "^18.2.44",
    "commitlint": "^17.0.2",
    "del-cli": "^5.1.0",
    "eslint": "^8.51.0",
    "eslint-config-prettier": "^9.0.0",
    "eslint-plugin-prettier": "^5.0.1",
    "jest": "^29.7.0",
    "prettier": "^3.0.3",
    "react": "18.3.1",
    "react-native": "0.76.1",
    "react-native-builder-bob": "^0.31.0",
    "release-it": "^17.10.0",
    "turbo": "^1.10.7",
    "typescript": "^5.2.2"
  },

@atlj atlj reopened this Nov 10, 2024
@ChoiHyeongu
Copy link

same here

@Francesco-Voto
Copy link

Same problem, looks like the problem could be the outputDIr

    "outputDir": {
      "ios": "ios/generated",
      "android": "android/generated"
    },

Looks like the folder does not exist anymore

@atlj
Copy link
Collaborator

atlj commented Nov 15, 2024

Looks like you're missing @react-native-community/cli in your root project's dev dependencies. You can go to example/package.json, grab the dependency version, and put it to the root package.json's devDependencies. It's strange since we already have a way of automatically adding this. I'm going to investigate this further.

@atlj
Copy link
Collaborator

atlj commented Nov 15, 2024

Looks like #684 should also fix this.

@bmahajanZ
Copy link
Author

bmahajanZ commented Nov 22, 2024

Sure, will try after adding the dependency. Although, the project was created using npx command so shouldn't it contain this dependency by default?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants