Open emclab opened 4 years ago
I am using libp2p (library that makes up ipfs) and I am getting very similar issue. I think it is due to modules 'bufferutil' and 'utf-8-validate'
Deepp0925
, have you found a solution for the issue? Or have an idea about how to solve?
No unfortunately
I believe the issue is that IPFS is trying to use ursaNative and secp256k1 native modules, which are not built for LiquidCore. I've gotten this to work in the past. You need to hack whichever module is trying to load those native bindings to skip them and use the JS-only implementations.
The LiquidCore 0.7.8 works fine before ipfs 0.43.3 installed with
yarn add ipfs
. There are 3 modules which is unresolvable - nanoid, utf-8-validate and bufferutil. Afteryarn add nanoid utf-8-validate bufferutil
, thenanoid
remains unresolvable. I didyarn add nanoid
again and here is the installation message:$ yarn add nanoid yarn add v1.22.0 warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json. [1/4] 🔍 Resolving packages... [2/4] 🚚 Fetching packages... warning Pattern ["nanoid@^3.1.5"] is trying to unpack in the same destination "/Users/zhouyiyun/Library/Caches/Yarn/v6/npm-nanoid-3.1.5-56da1bb76b619391fc61625e8b4e4bff309b9942-integrity/node_modules/nanoid" as pattern ["nanoid@^3.0.2","nanoid@^3.1.3","nanoid@^3.0.2"]. This could result in non-deterministic behavior, skipping. [3/4] 🔗 Linking dependencies... warning "ipfs > prometheus-gc-stats@0.6.2" has incorrect peer dependency "prom-client@>= 10 < 12". [4/4] 🔨 Building fresh packages... success Saved 1 new dependency. info Direct dependencies └─ nanoid@3.1.5 info All dependencies └─ nanoid@3.1.5 $ liquidcore postinstall Pod config complete ✨ Done in 12.60s. zhouyiyundeAir:nodejs_lc zhouyiyun$ pod install Analyzing dependencies Downloading dependencies Generating Pods project Integrating client project Pod installation complete! There are 3 dependencies from the Podfile and 3 total pods installed.
Here is the code in
example.js
which causes the error:The code launching the service is:
LCMicroServiceEventListener {
}
After click the button, the debug console shows the message:
2020-05-07 13:09:56.107740-0700 nodejs_lc[69749:24565022] MicroService User-Agent : LiquidCore/0.7.8 (iOS; API=13.3) 2020-05-07 13:10:05.262004-0700 nodejs_lc[69749:24565022] ursaNative has no registered native binding. 2020-05-07 13:10:05.389680-0700 nodejs_lc[69749:24565022] secp256k1 has no registered native binding. 2020-05-07 13:10:05.897140-0700 nodejs_lc[69749:24565022] stderr: Require cycle: node_modules/glob/glob.js -> node_modules/glob/sync.js -> node_modules/glob/glob.js
Require cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle. 2020-05-07 13:10:06.087506-0700 nodejs_lc[69749:24565022] stderr: Require cycle: node_modules/ipfs/src/core/components/index.js -> node_modules/ipfs/src/core/components/init.js -> node_modules/ipfs/src/core/components/index.js
Require cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle. 2020-05-07 13:10:06.157026-0700 nodejs_lc[69749:24565022] There is an unhandled exception! 2020-05-07 13:10:06.157361-0700 nodejs_lc[69749:24565022] Error: Error: Cannot resolve module 2020-05-07 13:10:06.158389-0700 nodejs_lc[69749:24565022] Stack: :180416