orlenyslp / Caterpillar

Caterpillar: A BPMN-based BPMS for Ethereum
BSD 3-Clause "New" or "Revised" License
122 stars 52 forks source link

TypeError: web3_eth_abi_1.AbiCoder is not a constructor #13

Open deenuka opened 5 years ago

deenuka commented 5 years ago

Getting below error when trying to build caterpillar-core. Please commit your package-lock.json

/Users/deenukaperera/Documents/Catepillar-2/Caterpillar/v3.0/caterpillar-core/out/models/models.controller.js:6
const abiCoder = new web3_eth_abi_1.AbiCoder();
                 ^

TypeError: web3_eth_abi_1.AbiCoder is not a constructor
    at Object.<anonymous> (/Users/deenukaperera/Catepillar-2/Caterpillar/v3.0/caterpillar-core/out/models/models.controller.js:6:18)
    at Module._compile (internal/modules/cjs/loader.js:816:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:827:10)
    at Module.load (internal/modules/cjs/loader.js:685:32)
    at Function.Module._load (internal/modules/cjs/loader.js:620:12)
    at Module.require (internal/modules/cjs/loader.js:723:19)
    at require (internal/modules/cjs/helpers.js:14:16)
    at Object.<anonymous> (/Users/deenukaperera/Catepillar-2/Caterpillar/v3.0/caterpillar-core/out/app.js:8:29)
    at Module._compile (internal/modules/cjs/loader.js:816:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:827:10)
    at Module.load (internal/modules/cjs/loader.js:685:32)
    at Function.Module._load (internal/modules/cjs/loader.js:620:12)
    at Module.require (internal/modules/cjs/loader.js:723:19)
    at require (internal/modules/cjs/helpers.js:14:16)
    at Object.<anonymous> (/Users/deenukaperera/Documents/Catepillar-2/Caterpillar/v3.0/caterpillar-core/out/www.js:3:15)
    at Module._compile (internal/modules/cjs/loader.js:816:30)
[20:02:47] [nodemon] app crashed - waiting for file changes before starting...
soerenmetje commented 4 years ago

Same here for v3.0. Any solutions?

nizarhmain commented 4 years ago

so go to the /out/models/models.controller and change the following line

// const abiCoder = new web3_eth_abi_1.AbiCoder();
const abiCoder = require("web3-eth-abi");

Also make sure to have mongod running at port 27017 !