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.

Bitcore-lib double instance

See original GitHub issue

Module eth-lightwallet and its’ dependencies have some issue with bitcore-lib version guard. I noticed that some of them have version 0.15 and other 0.14. Do you have any solution to this problem? Error that I receive is presented below.

(function (exports, require, module, __filename, __dirname) { var Module;if(!Module)Module=(typeof Module!=="undefined"?Module:null)||{};var moduleOverrides={};for(var key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var ENVIRONMENT_IS_WEB=typeof window==="object";var ENVIRONMENT_IS_WORKER=typeof importScripts==="function";var ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof require==="function"&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(ENVIRONMENT_IS_NODE){if(!Module["print"])Module["print"]=function print(x){process["stdout"].write(x+"\n")};if(!Module["printErr"])Module["printErr"]=function printErr(x){process["stderr"].write(x+"\n")};var nodeFS=require("fs");var nodePath=require("path");Module["read"]=function read(filename,binary){filename=nodePath["normalize"](filename);var ret=nodeFS["readFileSync"]

Error: More than one instance of bitcore-lib found. Please make sure to require bitcore-lib and check that submodules do not also include their own bitcore-lib dependency.
    at Object.bitcore.versionGuard (\GitHub\X\node_modules\eth-lightwallet\node_modules\bitcore-mnemonic\node_modules\bitcore-lib\index.js:12:11)
    at Object.<anonymous> (\GitHub\X\node_modules\eth-lightwallet\node_modules\bitcore-mnemonic\node_modules\bitcore-lib\index.js:15:9)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (\GitHub\X\node_modules\eth-lightwallet\node_modules\bitcore-mnemonic\lib\mnemonic.js:3:15)

Process finished with exit code 7`

Issue Analytics

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

github_iconTop GitHub Comments

Przemek-Wincommented, Oct 30, 2017

The solution provided there worked for me:

Well, this is far from a proper way to solve this issue, but you can get rid of this error by editing file


line 7: bitcore.versionGuard = function(version) { Change it to: bitcore.versionGuard = function(version) { return;

I did this and so far no problems.

debugginatorcommented, Jan 29, 2018

I was again getting this error and wrote my own workaround that doesn’t force you to edit node module files, unlike the previous hack. When importing lightwallet do this: try { var lightwallet = require(‘eth-lightwallet’); } catch (err) { delete global._bitcore var lightwallet = require(‘eth-lightwallet’); }

It took me a while and I know it looks funny, but for some reason only after requiring it for the first time does deleting global._bitcore make a difference.

Read more comments on GitHub >

github_iconTop Results From Across the Web

More than one instance of bitcore-lib found - BitPay
It looks like you're using two different versions of bitcore-lib in your code. If bitcore-lib sees a bitcore class (eg: PrivateKey) that was ......
Read more >
Bitcore = "Error: More than one instance of bitcore-lib found"
I don't know if that's the right method but it does work. delete global._bitcore var bitcore = require('bitcore-lib').
Read more >
How to solve More than one instance of bitcore-lib found error
I am trying to use bitcore-lib to generate bitcoin address and fetch unspent transaction using bitcore-explorer.
Read more >
Top 5 bitcore-lib Code Examples - Snyk
To help you get started, we've selected a few bitcore-lib examples, based on popular ways it is used in public projects. Secure your...
Read more >
Error when using bitcore-explorer with bitcore-lib (Bitcore)
~/bitcore-explorers/node_modules/bitcore-lib/index.js. line 7: bitcore. ... It has been raised multiple times in Github.
Read more >

github_iconTop Related Medium Post

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 Post

No results found

github_iconTop Related Hashnode Post

No results found