Skip to content

Commit

Permalink
Fixes FORCE_BUNDLING error when bundle js (#45871)
Browse files Browse the repository at this point in the history
Summary:
After enable FORCE_BUNDLING to true, build error.  cc blakef
![image](https://github.com/user-attachments/assets/42f7fed7-efa1-4c23-b812-db49b64d3bff)

![image](https://github.com/user-attachments/assets/4ac40c43-b404-4f3a-8b7d-3c2749f587ed)

## Changelog:

[IOS] [FIXED] - Fixes FORCE_BUNDLING error when bundle js

Pull Request resolved: #45871

Test Plan: enable FORCE_BUNDLING to true, build success.

Reviewed By: cipolleschi

Differential Revision: D60829522

Pulled By: blakef

fbshipit-source-id: cc8d3bf6a88a49010215acb958ad65e311f618b2
  • Loading branch information
zhongwuzw authored and facebook-github-bot committed Aug 8, 2024
1 parent ecc2910 commit 089e828
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/react-native/scripts/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@

const {bundleCommand: bc} = require('@react-native/community-cli-plugin');
const {execSync} = require('child_process');
const program = require('commander');
const commander = require('commander');
const {readFileSync} = require('fs');
const path = require('path');

// Commander 12.0.0 changes from the global to named export
const program = commander.program ?? commander;

program.version(
JSON.parse(
readFileSync(path.resolve(__dirname, '..', 'package.json'), 'utf8'),
Expand Down

1 comment on commit 089e828

@LA-Johan
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zhongwuzw just as a heads up, I was unable to Archive our React Native app using the CLI on version 0.75.1 until I added this change.

Please sign in to comment.