Skip to content

Conversation

@dmytrorykun
Copy link
Contributor

Summary:
When running codegen from pod install, something affects require.resolve, and it starts looking for codegen-enabled dependencies from the workspace root, not the current RN project root.
This is bad if we have different versions of same dependency across multiple workspaces. One of them will be hoisted to the workspace root, and will be used for all the workspaces.

This issue is described in details here #46196

This diff is supposed to fix this by adding the project root path to the require.resolve call.

Changelog: [iOS][Fixed] - Codegen will start looking for codegen-enabled dependencies from the project root.

Differential Revision: D61850219

Summary:
When running codegen from `pod install`, something affects `require.resolve`, and it starts looking for codegen-enabled dependencies from the workspace root, not the current RN project root.
This is bad if we have different versions of same dependency across multiple workspaces. One of them will be hoisted to the workspace root, and will be used for all the workspaces.

This issue is described in details here facebook#46196

This diff is supposed to fix this by adding the project root path to the `require.resolve` call.

Changelog: [iOS][Fixed] - Codegen will start looking for codegen-enabled dependencies from the project root.

Differential Revision: D61850219
@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Facebook Partner: Facebook Partner labels Aug 27, 2024
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D61850219

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 46d17ef.

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Aug 27, 2024
@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @dmytrorykun in 46d17ef

When will my fix make it into a release? | How to file a pick request?

cipolleschi pushed a commit that referenced this pull request Sep 11, 2024
…46229)

Summary:
Pull Request resolved: #46229

When running codegen from `pod install`, something affects `require.resolve`, and it starts looking for codegen-enabled dependencies from the workspace root, not the current RN project root.
This is bad if we have different versions of same dependency across multiple workspaces. One of them will be hoisted to the workspace root, and will be used for all the workspaces.

This issue is described in details here #46196

This diff is supposed to fix this by adding the project root path to the `require.resolve` call.

Changelog: [iOS][Fixed] - Codegen will start looking for codegen-enabled dependencies from the project root.

Reviewed By: cipolleschi

Differential Revision: D61850219

fbshipit-source-id: d60a0e72e9c60e862c0d64e227ea3652d1be5a90
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants