Web3.js: `callbackify` from 'util' doesn't seem to be available in the browser

Created on 24 Sep 2020  ยท  5Comments  ยท  Source: ChainSafe/web3.js

When using Browserify 16.5.2, here's what I get from require('util'), as logged by console.log:
```
_extend: function _extend(origin, add)โ€‹
debuglog: function debuglog(set)โ€‹
deprecate: function deprecate(fn, msg)โ€‹
format: function format(f)โ€‹
inherits: function inherits(ctor, superCtor)โ€‹
inspect: function inspect(obj, opts)โ€‹
isArray: function isArray(ar)โ€‹
isBoolean: function isBoolean(arg)โ€‹
isBuffer: function isBuffer(arg)โ€‹
isDate: function isDate(d)โ€‹
isError: function isError(e)โ€‹
isFunction: function isFunction(arg)โ€‹
isNull: function isNull(arg)โ€‹
isNullOrUndefined: function isNullOrUndefined(arg)โ€‹
isNumber: function isNumber(arg)โ€‹
isObject: function isObject(arg)โ€‹
isPrimitive: function isPrimitive(arg)โ€‹
isRegExp: function isRegExp(re)โ€‹
isString: function isString(arg)โ€‹
isSymbol: function isSymbol(arg)โ€‹
isUndefined: function isUndefined(arg)โ€‹
log: function log()โ€‹
: Object { โ€ฆ }


`callbackify` is not available. Yet, `web3` attempts to use it here:

https://github.com/ethereum/web3.js/blob/866cb9917474e6618851960000db26e118589cd6/packages/web3-core-requestmanager/src/index.js#L23

This produces an error wen I try to use `web3` 1.3.0 in the browser:

Uncaught (in promise) TypeError: callbackify is not a function
send index.js:139
sendRequest index.js:609
send index.js:636
get_account eth.js:92
get_account eth.js:91
ensure_enabled eth.js:66
main main.js:458
async*[12]< main.js:614
o _prelude.js:1
r _prelude.js:1
_prelude.js:1
```

Please revise web3 to avoid the use of callbackify, or adjust it to source the function in a way that works with browserify.

bug dependencies

All 5 comments

wow looking at are package.json and nonde_modules/util the version is at 0.10 where callbackifiy isn't available till later versions.
probably just need to bump the module thanks for the catch!

Any quick fixes for this?

I downgraded to an earlier web3.

September 29, 2020 4:35 AM, "Yash Shah" <[email protected] (mailto:[email protected]?to=%22Yash%20Shah%22%20notifications@github.com)> wrote:
Any quick fixes for this?

โ€”

You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub (https://github.com/ethereum/web3.js/issues/3727#issuecomment-700644447), or unsubscribe (https://github.com/notifications/unsubscribe-auth/AAFXTNRIMGHJ6XNX6VDUNC3SIHBA5ANCNFSM4RXUYEPA).

you could bump the dependency for utli in a local build to 0.12 or downgrade web3 as suggested

I downgraded it.
Thanks, @frankiebee @interfect

Was this page helpful?
0 / 5 - 0 ratings