Bitcore-lib double instance
See original GitHub issueModule 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:
- Created 6 years ago
- Comments:11 (2 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The solution provided there worked for me: https://github.com/bitpay/bitcore/issues/1454
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.