Web3.js: Node Error

Created on 10 Feb 2019  路  4Comments  路  Source: ChainSafe/web3.js

Expected behavior

UserStore.deployed() should return the instance of the contract

Actual behavior

Node Error: Method [object Object] not supported.

Steps to reproduce the behavior

  1. import TruffleContract from "truffle-contract";
  2. const Web3 = require("web3");
  3. const UserStoreArtifact = require("artifact.json");
    4.
const web3 =  new Web3(
  new Web3.providers.HttpProvider(`http://localhost:${8545}`)
);
  1. UserStore.setProvider(web3.currentProvider);
  2. const ins = await UserStore.deployed();

Error Logs

image

Versions

NPM - 6.4.1
Node - 10.15.1
Web3.js - 1.0.0-beta.37
OS - Windows 10
Device - Dell 7577

Most helpful comment

Thanks for submitting this issue. As I see from the error message you are using a version higher then beta.37. Truffle does currently only support until version beta.37 of the Web3.js library.

Please be sure you are using the right version.

All 4 comments

While using truffle console, I am able to get the Instance of the contract.

Thanks for submitting this issue. As I see from the error message you are using a version higher then beta.37. Truffle does currently only support until version beta.37 of the Web3.js library.

Please be sure you are using the right version.

Thanks for submitting this issue. As I see from the error message you are using a version higher then beta.37. Truffle does currently only support until version beta.37 of the Web3.js library.

Please be sure you are using the right version.

But he use exactly version beta.37 !

鍚屻仒鍟忛銇岀櫤鐢熴仐銇︺亜銇俱仚

Was this page helpful?
0 / 5 - 0 ratings