{"record":{"id":"ae2602759be2590f","repo":"ethereum/go-ethereum","slug":"cannot-send-value-to-non-payable-constructor","errorCode":null,"errorMessage":"Cannot send value to non-payable constructor","messagePattern":"Cannot send value to non-payable constructor","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"internal/jsre/deps/web3.js","lineNumber":2988,"sourceCode":"        var callback;\n\n        var args = Array.prototype.slice.call(arguments);\n        if (utils.isFunction(args[args.length - 1])) {\n            callback = args.pop();\n        }\n\n        var last = args[args.length - 1];\n        if (utils.isObject(last) && !utils.isArray(last)) {\n            options = args.pop();\n        }\n\n        if (options.value > 0) {\n            var constructorAbi = abi.filter(function (json) {\n                return json.type === 'constructor' && json.inputs.length === args.length;\n            })[0] || {};\n\n            if (!constructorAbi.payable) {\n                throw new Error('Cannot send value to non-payable constructor');\n            }\n        }\n\n        var bytes = encodeConstructorParams(this.abi, args);\n        options.data += bytes;\n\n        if (callback) {\n\n            // wait for the contract address and check if the code was deployed\n            this.eth.sendTransaction(options, function (err, hash) {\n                if (err) {\n                    callback(err);\n                } else {\n                    // add the transaction hash\n                    contract.transactionHash = hash;\n\n                    // call callback for the first time\n                    callback(null, contract);","sourceCodeStart":2970,"sourceCodeEnd":3006,"githubUrl":"https://github.com/ethereum/go-ethereum/blob/6bb0588ad8e7f922e4ad5580f51265a4097af08f/internal/jsre/deps/web3.js#L2970-L3006","documentation":"Filter.get() supports both sync and async styles. In synchronous mode it reads this.filterId; if the filter has not been created yet (filterId === null, creation is asynchronous), it cannot chain synchronously and throws this error telling you to pass a callback. The filter id only exists after the async creation round-trip completes.","triggerScenarios":"Calling web3.eth.filter({...}).get() immediately in the console (or without new) so get() runs before the filter creation callback has assigned filterId. Typical in the geth console one-liner: var f = eth.filter('latest'); f.get(); fired too early.","commonSituations":"Interactive geth console usage where the user expects synchronous semantics, or scripts that ignore the async nature of filter creation in the bundled web3 version.","solutions":["Use the callback form: f.get(function(err, logs) { ... }).","Or wait for filter creation to finish before calling get() synchronously.","For one-shot history, prefer eth.getPastLogs / getLogs-style APIs which are callback/Promise based."],"exampleFix":"// before\nvar f = eth.filter({fromBlock: 0, toBlock: 'latest'});\nvar logs = f.get(); // throws when filterId is null\n\n// after\nvar f = eth.filter({fromBlock: 0, toBlock: 'latest'});\nf.get(function (err, logs) { console.log(logs); });","handlingStrategy":"validation","validationCode":"function getFilterLogsSync(f) {\n  if (f.filterId === null || f.filterId === undefined) {\n    throw new Error('filter not yet created; use f.get(callback)');\n  }\n  return f.get();\n}","typeGuard":"function isFilterReady(f) { return f && f.filterId !== null && f.filterId !== undefined; }","tryCatchPattern":null,"preventionTips":["Prefer the callback form of get() in console and scripts.","Treat filter creation as async; never chain get() immediately after eth.filter()."],"tags":["web3","filters","async"],"backgroundTag":null,"analyzedSha":"6bb0588ad8e7f922e4ad5580f51265a4097af08f","analyzedAt":"2026-08-15T10:06:53.996Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}