callstack / react-native-builder-bob

👷‍♂️ Simple set of CLIs to scaffold and build React Native libraries for different targets
https://callstack.github.io/react-native-builder-bob/
2.78k stars 184 forks source link

bob build failed generate the codegen files #667

Closed pnthach95 closed 3 hours ago

pnthach95 commented 3 hours ago

Description

I upgraded builder-bob to 0.30.3 and tried to execute prepare task but it failed

Executing task: yarn run 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
✖ 
/Volumes/code/Projects/awesome-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 (/Volumes/code/Projects/awesome-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 (/Volumes/code/Projects/awesome-library/node_modules/react-native-builder-bob/lib/index.js:421:7)

Node.js v20.12.1

This error is same as #662 but example can build and run

Packages

Selected options

✔ What is the name of the npm package? … react-native-awesome-library ✔ What is the description for the package? … test rn76 ✔ What is the name of package author? … Pham Ngoc Thach ✔ What is the email address for the package author? … thachxyz123@gmail.com ✔ What is the URL for the package author? … @pnthach95 ✔ What is the URL for the repository? … pnthach95/react-native-awesome-library ✔ What type of library do you want to develop? › Turbo module with backward compat ✔ Which languages do you want to use? › Kotlin & Objective-C ✔ What type of example app do you want to create? › Vanilla

Link to repro

https://github.com/pnthach95/react-native-awesome-library

Environment

OS: macOS 15.0.1 CPU: (8) arm64 Apple M1 Node: version: 20.12.1 path: ~/.nvm/versions/node/v20.12.1/bin/node Yarn: version: 3.6.4 path: ~/.nvm/versions/node/v20.12.1/bin/yarn npm: version: 10.8.2 path: ~/.nvm/versions/node/v20.12.1/bin/npm

atlj commented 3 hours ago

Hey, we shipped a fix with CRNL 0.42.2 and Builder Bob 0.30.3. Could you try it? I'm closing the issue please reopen it if this didn't fix the issue