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

create-react-native-library: Failed generate the codegen file #138

Closed
boek opened this issue Oct 24, 2024 · 7 comments
Closed

create-react-native-library: Failed generate the codegen file #138

boek opened this issue Oct 24, 2024 · 7 comments

Comments

@boek
Copy link
Collaborator

boek commented Oct 24, 2024

first time setting up a react native build on this machine following the getting started guide and ran into this error

/Users/jboek/Developer/tmp/rnrust/my-rust-lib/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 (/Users/jboek/Developer/tmp/rnrust/my-rust-lib/node_modules/react-native-builder-bob/lib/targets/codegen.js:48:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async buildTarget (/Users/jboek/Developer/tmp/rnrust/my-rust-lib/node_modules/react-native-builder-bob/lib/index.js:421:7)

Was able to get past it by adding "@react-native-community/cli": "latest", to my devDependencies in the project. We may want to either call this out as a dependency to install globally or include it in the devDependencies in the template.

@Johennes
Copy link
Collaborator

Johennes commented Oct 24, 2024

This is interesting because in https://github.com/unomed-dev/react-native-matrix-sdk/blob/main/yarn.lock#L10774 (which was generated with create-react-native-library) I'm getting this package as a direct dependency of react-native itself. 🤔

Could you maybe double check your yarn.lock file to see if there's really nothing else that would already pull this in?

@jhugman
Copy link
Owner

jhugman commented Oct 24, 2024

This may be related to callstack/react-native-builder-bob#662 , reported earlier today.

@Johennes
Copy link
Collaborator

Oh, great find! Unfortunately, running into regressions when integrating the various tools in the RN ecosystem is a somewhat common annoyance in my experience. 😞

Maybe we could try to pin the RN version in the guide?

@atlj
Copy link

atlj commented Oct 24, 2024

FYI: callstack/react-native-builder-bob#665

The fix is to add "@react-native-community/cli": "15.0.0-alpha.2", or with the version you desire to the root package's devDependencies.

@jhugman
Copy link
Owner

jhugman commented Oct 28, 2024

This appears to be fixed; thank you @atlj .

@jhugman jhugman changed the title Missing dev dependency when building create-react-native-library: Failed generate the codegen file Oct 28, 2024
@jhugman jhugman closed this as completed Oct 28, 2024
@atlj
Copy link

atlj commented Oct 28, 2024

Out of context:

This project looks pretty interesting. If you have any other problems with CRNL or builder bob, please feel free to ping me.

@jhugman
Copy link
Owner

jhugman commented Oct 28, 2024

This project looks pretty interesting. If you have any other problems with CRNL or builder bob, please feel free to ping me.

Sure thing! Thank you for everything you do!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants