-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error related to grpc package #6
Comments
Have you upgrade to [email protected]? prior to this version, there's an issue when run on browser. |
Yes I am using [email protected]. Not sure if the issue is related to grpc. |
@asghaier76 I don't have a skill on angular, could you please share me your project that I can run and reproduce the error, or perhaps the steps on setting the project to reproduce this error, thanks. |
@totiz I have sent you an invite to the repo |
@totiz have you had the chance to clone the repo and test |
Ok I got it, I'll let you know if I try and have any update, thanks. |
@asghaier76 Ok I run your project and got the error, This's a known error that doesn't cause Vue project to crash but on Angular I've never try (and React as well). The problem:grpc can not be load on browser, so I try to separate the require('grpc') by checking that the project run with grpc-web or not, then load. Workaround:
// Init Admission Controller Proxy
if (this.config.dataProtocol === 'grpc') {
// this.admissionControlProxy = require('./Node');
} PS: you should upgrade to [email protected] for new minting protocol https://github.com/kulapio/libra-core/releases/tag/v1.0.15 Please let me know if you're still have problems. And just leave this issue open, because we still need a patch for completely fix. |
@totiz while this fixes the error at compilation time still it brings issues in in run time so after using the workaround and comment only this line
I can compile and generate wallets but once try to connect to the Blockchain for example to retrieve balance I get this error
and it fails to create an instance of LibraClient which I am initiating and querying balance using these lines
It seems by commenting that line the admissionControlProxy is not defined, so I went on and commented the this section
so that admissionControlProxy is defined but I got another type of error
The LibraClient object instance looks like
I am not sure if the ServersHost config file need to be modified |
On the browser you need to init client with this code. // On Browser
const client = new LibraClient({
transferProtocol: 'https',
host: 'ac-libra-testnet.kulap.io',
port: '443',
dataProtocol: 'grpc-web-text'
}) Please let me know if still has any problems. |
Thanks @totiz It works with this endpoint. Great work Kulap team. |
I am trying to use this library in an Angular project and I am getting this error
ERROR in ./node_modules/grpc/node_modules/detect-libc/lib/detect-libc.js
Module not found: Error: Can't resolve 'child_process' in '../node_modules/grpc/node_modules/detect-libc/lib'
I am using
Node: 12.4.0
OS: darwin x64
Angular: 8.1.3
Any help on this issue?
Ahmad
The text was updated successfully, but these errors were encountered: