question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue when running a built version

See original GitHub issue

Hey there, I’ve been working on a small project using your library and everything is working top notch.

Today I tried to host the build version of my app but ran into an issue 😦 I’d like to know if you know why this happens…

My project was created using the create-react-app npm package and built using the build command available in a create-react-app project

After building the project everything js related is found in the /service-worker.js and /static/js/main.645d2b1c.js files.

This is my code (keep in mind that I’m trying to create a bitcoin wallet):

const randomBytes = crypto.randomBytes(16);
const mnemonic = bip39.entropyToMnemonic(randomBytes.toString('hex'));

const seed = bip39.mnemonicToSeed(mnemonic);
const bitcoinNetwork = bitcoin.networks.bitcoin;
const hdMaster = bitcoin.HDNode.fromSeedBuffer(seed, bitcoinNetwork);

const key = hdMaster.derivePath("m/0");
const address = key.keyPair.getAddress();
const secret = key.keyPair.toWIF();

This is the error I get: "Expected property "0" of type ECPair, got r" on this line: const hdMaster = bitcoin.HDNode.fromSeedBuffer(seed, bitcoinNetwork);

When everything gets compiled and minified the seed constant gets renamed to r

So I’m wondering if you would know why a built version would throw such error?

Thanks

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
dabura667commented, Jan 21, 2018

Please read the readme.

You need to reserve words in your uglify step.

ECPair is getting mangled.

0reactions
dabura667commented, Jan 22, 2018

Looking at the wallets on bitcoin.org

Every single wallet that offers single sig p2pkh uses BIP44 except breadwallet.

Outside of that, I can think of Copay and its derivitaves (bitcoin.com wallet), btc.com wallet, samourai wallet, Edge wallet (last two are in beta) all use BIP44 for p2pkh.

Soooo 99%?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Visual Studio keeps running the old build - Stack Overflow
Does everything work properly if you manually build the project? From the "Build" menu, click "Rebuild Solution". Then try to run your project....
Read more >
Common Build Problems - Travis CI Docs
Check the list of dependencies in the build log, usually output including versions and see, if there's anything that's changed. Sometimes, this can...
Read more >
Troubleshooting builds - Gradle User Manual
If gradle --version works, but all of your builds fail with the same error, it is possible there is a problem with one...
Read more >
September 13, 2022—KB5017328 (OS Build 22000.978)
This issue occurs on devices that have installed KB5016691. Addresses security issues for your Windows operating system.
Read more >
Known issues with Android Studio and Android Gradle Plugin
Starting with version 4.2, Android Studio now runs on JDK 11. ... When you navigate to Build > Generate Signed Bundle / APK...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found