Haul: Lottie + Haul dosn't work while remote debug is on

Created on 8 Nov 2017  路  6Comments  路  Source: callstack/haul

The problem is related to Lottie

Current Behavior

When you start to debug remotely it fails with an error Cannot create property 'runCommand' on string 'LottieAnimationView'

Expected Behavior

Debug remotely should be possible

Haul Configuration (webpack.haul.js)

module.exports = ({ platform }) => ({
  entry: `./index.${platform}.js`,
})

| software | version
| ---------------- | -------
| Haul | v1.0.0-beta.9
| react-native | 0.49.3
| node | v8.6.0
| npm or yarn | 1.2.1
| lottie-react-native | 2.2.7

bug

Most helpful comment

@chelovekdrakon
There's a looseMode property in configuration now: https://github.com/callstack/haul/blob/master/docs/Configuration.md
Here's a recipe:
https://github.com/callstack/haul/blob/master/docs/Recipes.md#using-with-lottie-or-loose-mode-only-compatible-libraries

All 6 comments

@jukben what is the solution for this? I've just upgraded haul from 1.0.0-rc15 to 0.13.1 and run into this error.
@satya164 could you help me with this?

In NativeSafeComponent.js on componnet LottieAnimationView code try to set runCommand property : Function

@zamotany Aloha!
Here is a sample project with a repro of the issue: https://github.com/chelovekdrakon/lottie-issue/tree/lottie-haul

Temporary workaround:

  1. Install remove-strict-webpack-plugin
  2. Add this plugin to the Webpack config like so:
import {withPolyfills, makeConfig} from '@haul-bundler/preset-0.60';
import RemoveStrict from 'remove-strict-webpack-plugin';

export default makeConfig({
  bundles: {
    index: {
      entry: withPolyfills('./index'),
      transform({config}) {
        config.plugins.push(new RemoveStrict());
      },
    },
  },
});

(Don't worry about the errors, it works fine).

Use this workaround until the proper fix lands.

@zamotany thank you for fixing it!
How should we use it now instead of config.plugins.push(new RemoveStrict()); ?

@chelovekdrakon
There's a looseMode property in configuration now: https://github.com/callstack/haul/blob/master/docs/Configuration.md
Here's a recipe:
https://github.com/callstack/haul/blob/master/docs/Recipes.md#using-with-lottie-or-loose-mode-only-compatible-libraries

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tkow picture tkow  路  3Comments

Traviskn picture Traviskn  路  4Comments

hesyifei picture hesyifei  路  4Comments

aaronkchsu picture aaronkchsu  路  5Comments

tachtevrenidis picture tachtevrenidis  路  3Comments