LoginSignup
0
1

More than 5 years have passed since last update.

[備忘録]Web3.jsのバージョン違いによる罠

Last updated at Posted at 2019-02-06

Web3.jsをのリファレンスのサンプルコードを真似していたらエラーが出る。

Uncaught TypeError: web3.eth.Contract is not a constructor

面白いこと言うじゃん。。。

ぐぐったら同じ現象のひとがいた。

TypeError: web3.eth.Contract is not a constructor (What is the reason ?)

結論:バージョンが古い。1.0以上を使おう。

web3.jsのバージョンを調べてみたら、

> version = web3.version
> {api: "0.20.6", getNode: ƒ, getNetwork: ƒ, …}

草。

古い情報が溢れているので、気をつけましょう。という話。
ではなくちゃんと調べようという話。


【追記】2019.2.7
いろいろ調べてたら1.0はベータ版。0.20.6が安定しているみたいな。
0.20.6のリファレンスを探して書いてみる。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1