Bitcoinjs-lib: Expected property "0" of type ECPair, got i

Created on 26 Jan 2018  路  9Comments  路  Source: bitcoinjs/bitcoinjs-lib

I try use react application, on develop server all works fine, but when i build it i have a problem on step bitcoin.HDNode.seedFromBuffer

external how to / question / docs

Most helpful comment

For anyone facing same issue, it is a bug on uglifyjsPlugin.Adding line below to uglify option solved it.

mangle: {
  safari10: true,
  keep_fnames: true
}

All 9 comments

In debbuger i see network is undefined

Read the readme.

You need to reserve keywords in uglify.

You mean this?
uglifyjs ... --mangle reserved=['BigInteger','ECPair','Point']
Only this keywords?

Yes

I add to webpack UglifyJsPlugin this

      mangle: {
        safari10: true,
          reserved: ["BigInteger","ECPair","Point"]
      }

not work :(

Ask uglifyjsPlugin devs.

@totaki the issue you present is that ECPair was mangled. For better or worse, that is the problem you need to solve.

In 4.0.0 we hope to minimalize these errors by removing the need to detect types via their constructor names.

For anyone facing same issue, it is a bug on uglifyjsPlugin.Adding line below to uglify option solved it.

mangle: {
  safari10: true,
  keep_fnames: true
}

With Webpack 4 and Terser:

  optimization: {
    minimizer: [
      new TerserPlugin({
        terserOptions: {
          keep_fnames: true,
          safari10: true,
        },
      }),
    ],
  },
Was this page helpful?
0 / 5 - 0 ratings

Related issues

ishwarchandratiwari picture ishwarchandratiwari  路  3Comments

namnv04 picture namnv04  路  3Comments

coingeek picture coingeek  路  4Comments

ghost picture ghost  路  3Comments

thrastarson picture thrastarson  路  3Comments