raineorshine / solidity-repl

Ethereum Solidity REPL
ISC License
398 stars 31 forks source link

callback is not a function #11

Closed liyuechun closed 6 years ago

liyuechun commented 7 years ago

liyuechun:~ yuechunli$ solr Welcome to the Solidity REPL!

uint a = 10 uint b = 20 a + b /usr/local/lib/node_modules/solidity-repl/node_modules/solc/soljson.js:1 (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";var ret=nodeFS["readFileSync"]

TypeError: callback is not a function at /usr/local/lib/node_modules/solidity-repl/node_modules/web3/lib/web3/property.js:119:13 at /usr/local/lib/node_modules/solidity-repl/node_modules/web3/lib/web3/requestmanager.js:82:20 at /usr/local/lib/node_modules/solidity-repl/node_modules/ethereumjs-testrpc/build/lib.node.js:40899:9 at /usr/local/lib/node_modules/solidity-repl/node_modules/ethereumjs-testrpc/build/lib.node.js:8420:16 at replenish (/usr/local/lib/node_modules/solidity-repl/node_modules/ethereumjs-testrpc/build/lib.node.js:8940:25) at iterateeCallback (/usr/local/lib/node_modules/solidity-repl/node_modules/ethereumjs-testrpc/build/lib.node.js:8930:17) at /usr/local/lib/node_modules/solidity-repl/node_modules/ethereumjs-testrpc/build/lib.node.js:8905:16 at async.eachSeries.resultObj.id (/usr/local/lib/node_modules/solidity-repl/node_modules/ethereumjs-testrpc/build/lib.node.js:40881:9) at /usr/local/lib/node_modules/solidity-repl/node_modules/ethereumjs-testrpc/build/lib.node.js:11082:16 at replenish (/usr/local/lib/node_modules/solidity-repl/node_modules/ethereumjs-testrpc/build/lib.node.js:8945:17) at iterateeCallback (/usr/local/lib/node_modules/solidity-repl/node_modules/ethereumjs-testrpc/build/lib.node.js:8930:17) at /usr/local/lib/node_modules/solidity-repl/node_modules/ethereumjs-testrpc/build/lib.node.js:8905:16 at async.eachSeries.resultObj.id (/usr/local/lib/node_modules/solidity-repl/node_modules/ethereumjs-testrpc/build/lib.node.js:40881:9) at /usr/local/lib/node_modules/solidity-repl/node_modules/ethereumjs-testrpc/build/lib.node.js:11082:16 at replenish (/usr/local/lib/node_modules/solidity-repl/node_modules/ethereumjs-testrpc/build/lib.node.js:8945:17) at iterateeCallback (/usr/local/lib/node_modules/solidity-repl/node_modules/ethereumjs-testrpc/build/lib.node.js:8930:17) liyuechun:~ yuechunli$ clear

liyuechun:~ yuechunli$ solr Welcome to the Solidity REPL!

uint a = 10 uint b = 20
uint c = a + b c /usr/local/lib/node_modules/solidity-repl/node_modules/solc/soljson.js:1 (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";var ret=nodeFS["readFileSync"]

TypeError: callback is not a function at /usr/local/lib/node_modules/solidity-repl/node_modules/web3/lib/web3/property.js:119:13 at /usr/local/lib/node_modules/solidity-repl/node_modules/web3/lib/web3/requestmanager.js:82:20 at /usr/local/lib/node_modules/solidity-repl/node_modules/ethereumjs-testrpc/build/lib.node.js:40899:9 at /usr/local/lib/node_modules/solidity-repl/node_modules/ethereumjs-testrpc/build/lib.node.js:8420:16 at replenish (/usr/local/lib/node_modules/solidity-repl/node_modules/ethereumjs-testrpc/build/lib.node.js:8940:25) at iterateeCallback (/usr/local/lib/node_modules/solidity-repl/node_modules/ethereumjs-testrpc/build/lib.node.js:8930:17) at /usr/local/lib/node_modules/solidity-repl/node_modules/ethereumjs-testrpc/build/lib.node.js:8905:16 at async.eachSeries.resultObj.id (/usr/local/lib/node_modules/solidity-repl/node_modules/ethereumjs-testrpc/build/lib.node.js:40881:9) at /usr/local/lib/node_modules/solidity-repl/node_modules/ethereumjs-testrpc/build/lib.node.js:11082:16 at replenish (/usr/local/lib/node_modules/solidity-repl/node_modules/ethereumjs-testrpc/build/lib.node.js:8945:17) at iterateeCallback (/usr/local/lib/node_modules/solidity-repl/node_modules/ethereumjs-testrpc/build/lib.node.js:8930:17) at /usr/local/lib/node_modules/solidity-repl/node_modules/ethereumjs-testrpc/build/lib.node.js:8905:16 at async.eachSeries.resultObj.id (/usr/local/lib/node_modules/solidity-repl/node_modules/ethereumjs-testrpc/build/lib.node.js:40881:9) at /usr/local/lib/node_modules/solidity-repl/node_modules/ethereumjs-testrpc/build/lib.node.js:11082:16 at replenish (/usr/local/lib/node_modules/solidity-repl/node_modules/ethereumjs-testrpc/build/lib.node.js:8945:17) at iterateeCallback (/usr/local/lib/node_modules/solidity-repl/node_modules/ethereumjs-testrpc/build/lib.node.js:8930:17) liyuechun:~ yuechunli$ solr Welcome to the Solidity REPL!

uint b = 20 uint a = 10 msg.sender /usr/local/lib/node_modules/solidity-repl/node_modules/solc/soljson.js:1 (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";var ret=nodeFS["readFileSync"]

TypeError: callback is not a function at /usr/local/lib/node_modules/solidity-repl/node_modules/web3/lib/web3/property.js:119:13 at /usr/local/lib/node_modules/solidity-repl/node_modules/web3/lib/web3/requestmanager.js:82:20 at /usr/local/lib/node_modules/solidity-repl/node_modules/ethereumjs-testrpc/build/lib.node.js:40899:9 at /usr/local/lib/node_modules/solidity-repl/node_modules/ethereumjs-testrpc/build/lib.node.js:8420:16 at replenish (/usr/local/lib/node_modules/solidity-repl/node_modules/ethereumjs-testrpc/build/lib.node.js:8940:25) at iterateeCallback (/usr/local/lib/node_modules/solidity-repl/node_modules/ethereumjs-testrpc/build/lib.node.js:8930:17) at /usr/local/lib/node_modules/solidity-repl/node_modules/ethereumjs-testrpc/build/lib.node.js:8905:16 at async.eachSeries.resultObj.id (/usr/local/lib/node_modules/solidity-repl/node_modules/ethereumjs-testrpc/build/lib.node.js:40881:9) at /usr/local/lib/node_modules/solidity-repl/node_modules/ethereumjs-testrpc/build/lib.node.js:11082:16 at replenish (/usr/local/lib/node_modules/solidity-repl/node_modules/ethereumjs-testrpc/build/lib.node.js:8945:17) at iterateeCallback (/usr/local/lib/node_modules/solidity-repl/node_modules/ethereumjs-testrpc/build/lib.node.js:8930:17) at /usr/local/lib/node_modules/solidity-repl/node_modules/ethereumjs-testrpc/build/lib.node.js:8905:16 at async.eachSeries.resultObj.id (/usr/local/lib/node_modules/solidity-repl/node_modules/ethereumjs-testrpc/build/lib.node.js:40881:9) at /usr/local/lib/node_modules/solidity-repl/node_modules/ethereumjs-testrpc/build/lib.node.js:11082:16 at replenish (/usr/local/lib/node_modules/solidity-repl/node_modules/ethereumjs-testrpc/build/lib.node.js:8945:17) at iterateeCallback (/usr/local/lib/node_modules/solidity-repl/node_modules/ethereumjs-testrpc/build/lib.node.js:8930:17)

raineorshine commented 7 years ago

I spent a long time upgrading solc this morning and I am still stuck on the same problem. It has something to do with a callback not being passed to web3.

If anyone else can investigate that would be great! I will take a look again when I can.

raineorshine commented 7 years ago

@liyuechun Hi! Will you try now? It took me a long time to track it down to a regression in TestRPC. The internal provider doesn't seem to work anymores so you have to run testrpc globally (see README).

Hopefully the regression gets fixed in the future, but this should work for now.

Let me know if it works for you! New version published @ v0.3.1.