Haul: Xcode shell script errors after update to Babel 7 / RN 0.57

Created on 25 Jan 2019  路  7Comments  路  Source: callstack/haul

Current Behavior

I'm upgrading from React Native 0.56 to React Native 0.57. I have to update babel 7 to make this work. So I followed these steps from the React Native changelog. And some of the tips in #411. But I get a lot of errors from the haul shell script when I build in xCode afterwards.

Xcode
(and +/- 1200 more like this)

I'm using version 0.45.1 of metro-react-native-babel-preset in my .babelrc as suggested by the React Native upgrade guide. But the same issue appears when using babel-preset-react-native (both V4 and V5).

Expected Behavior

There is no exit code so the build completes "successful" and everything in the app seems to work. But preferably without all the errors in xcode. I still have issue #487 when I make a release build which should be fixed with this haul version.

Haul Configuration (webpack.haul.js)

let srcAppPath = path.join(__dirname, 'src');
let nodeModulesPath = path.join(__dirname, 'node_modules');

module.exports = ({platform}, defaults) => {
    const config = {
        entry: `./index.js`,
        resolve: {
            ...defaults.resolve,
            plugins: [...defaults.resolve.plugins],
            modules: [srcAppPath, nodeModulesPath],
            extensions: ['.native.js', '.js', '.ejs', '.jsx', '.less', 'html', 'json', `.${platform}.js`, ...defaults.resolve.extensions],
            alias: {
                _COMPONENTS: 'js/components',
                _LIBS: 'js',
                _CONFIG: 'config',
            },
        },
    };

    return config;
};

Your Environment

| software | version
| ---------------- | -------
| Haul | RC-09, RC-10 and RC-11 (tried multiple versions)
| react-native | 0.57.8
| node | 10.15.0
| npm or yarn | npm 6.4.1

Most helpful comment

Can you try adding export EXTRA_PACKAGER_ARGS="--progress verbose" somewhere before you call react-native-xcode.sh?

All 7 comments

Can you try adding --progress verbose when you call Haul, e.g. haul bundle --progress verbose. Haul is using simple-progress-webpack-plugin for logging, and only verbose is not using characters that Xcode interprets as error code.

Thanks for your response. That doesn't work unfortunately. The error seems to be called from this script: Bundle React Native code and images

# added by Haul
export CLI_PATH=node_modules/haul/bin/cli.js
export NODE_BINARY=node
../node_modules/react-native/scripts/react-native-xcode.sh

And not from the haul session that is running at that moment.

Can you try adding export EXTRA_PACKAGER_ARGS="--progress verbose" somewhere before you call react-native-xcode.sh?

Nice that works. I'm still have an issue with release builds but that's most likely caused by something else. Thanks.

@tido64 I really really appreciate to your answer.
I use fastlane and I found its build process fails because of this error .
But, this error is very difficult to find except xcode console because fastlane always stop process their last of build with confusing error message looks throughly unrelated to this.

https://github.com/fastlane/fastlane/issues/8638

I looked for solution for 6hours and this is serious problem for me, so, I logged it for someone.
If you use haul and fastlane, then you see ARCHIVE FAILED, exit status: 65 and occur, this issue may be reason.

Let's fix this once and for all :)

We stumbled across this error as well, and it appears to be due to the output from simple-progress-webpack-plugin. When configured to use one of the CI specific formatters, everything is fine.

See this link for documentation as to which ones are CI specific: https://github.com/dominique-mueller/simple-progress-webpack-plugin

I propose haul defaults to using either --progress verbose or --progress expanded to avoid having issues with others using haul for xcode and fastlane.

Fastlane was particularly bad at identifying this error, xCode is slightly better, but it is still "mysterious".

I'm happy to submit a pull request with the default progress bar set to expanded or verbose, but want to ensure the maintainers are for this change.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

aaronkchsu picture aaronkchsu  路  5Comments

ellereeeee picture ellereeeee  路  3Comments

EamonnLaffey picture EamonnLaffey  路  5Comments

larixer picture larixer  路  6Comments

hesyifei picture hesyifei  路  4Comments