Skip to content
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

[BUG]Error when importing #10

Open
Steve-Mc opened this issue Jun 28, 2019 · 2 comments
Open

[BUG]Error when importing #10

Steve-Mc opened this issue Jun 28, 2019 · 2 comments

Comments

@Steve-Mc
Copy link

Steve-Mc commented Jun 28, 2019

The following line

import { LibraClient, LibraNetwork } from 'libra-core'

causes an error for me when used i angular. The error is:

index.js:3 Uncaught TypeError: Cannot read property '_handle' of undefined at index.js:3 at Array.forEach (<anonymous>) at module.exports (index.js:2) at Object.<anonymous> (log.js:11) at Object.213._process (log.js:310) at o (_prelude.js:1) at _prelude.js:1 at Object.<anonymous> (napi.js:5) at Object.211._process (napi.js:204) at o (_prelude.js:1)

Seems to be:
if (stream._handle && stream.isTTY && typeof stream._handle.setBlocking === 'function')

causing the issue.

When using require with node I receive an Unexpected Identifier error when trying to require the package.

@jeffslofish
Copy link

I get the same error when trying to run in react:

TypeError: Cannot read property '_handle' of undefined
(anonymous function)
node_modules/libra-core/node_modules/grpc/node_modules/set-blocking/index.js:3
  1 | module.exports = function (blocking) {
  2 |   [process.stdout, process.stderr].forEach(function (stream) {
> 3 |     if (stream._handle && stream.isTTY && typeof stream._handle.setBlocking === 'function') {
  4 |       stream._handle.setBlocking(blocking);
  5 |     }
  6 |   });

I believe the problem is that to use grpc for the web you need to use the grpc-web package instead of grpc, which appears to be a somewhat different interface.

@perfectmak
Copy link
Owner

Yes, I recently realized this grpc not working in the web. I plan to look into this as soon as I finish with other features currently in the pipeline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants