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
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,
},
}),
],
},
Most helpful comment
For anyone facing same issue, it is a bug on uglifyjsPlugin.Adding line below to uglify option solved it.