node_modules/web3-core/dist/web3-core.cjs.js:148
throw new Error("Missing parameter: ".concat(name));
Error: Missing parameter: provider
I am getting this error when using web3 version "web3": "^1.0.0-beta.39"
truffle version: ^4.0.2
Can anyone help me with this error?
Package Web3 have many changes in last version (see ethereum/web3.js#2000). It looks like that Truffle currently doesn't support them.
This should really be fixed, because it is currently impossible to use truffle-contract with three latest web3 versions (previous versions also caused errors in #1617 and #1614).
Temporary solution may be do downgrade Web3, possibly to 1.0.0-beta.33.
Thanks, @filips123 for your quick response.
I have asked the same question on web3 but they are saying that you guys are using unofficial API.

I have done a temporary solution.
I'm experiencing this issue too and downgraded Web3 package, but it's blocking from publishing a package. No end user should do workarounds.
For what it is worth, in addition to beta.33 reported above, going back to beta.37
"web3": "^1.0.0-beta.37",
"web3-core-promievent": "^1.0.0-beta.37",
work for me
Web3 beta 37 have problems with Webpack and React (#1617 and #1614).
This is the most urgent bug of all here I would say. I just created a new truffle project. Wont run.
We are looking into this issue as a matter of top priority.
Can someone provide reproduce steps for the latest version of Truffle so we can validate potential fixes?
Heads up, we are planning to release today without web3 fixes, but we will look into getting another release shortly after that.
Reproduce steps:
Create NPM project and require truffle-contract and web3 (version 1.0.0-beta.38 or later).
Open the file in that project and require packages truffle-contract and web3:
const Web3 = require('web3')
const TruffleContract = require('truffle-contract')
When you run a file at this point, you would probably already see an error.
If the error doesn't appear, try to use truffle-contract:
web3 = new Web3(exampleProvider) // Some test provider
contract = TruffleContract(exampleContract) // Some test contract
contract.setProvider(web3.currentProvider)
A smaller reproduction script is:
npm init -ynpm install truffle-contractnode --eval 'require("truffle-contract")'It results in this error:
/private/tmp/repro/node_modules/web3-core/dist/web3-core.cjs.js:148
throw new Error("Missing parameter: ".concat(name));
^
Error: Missing parameter: provider
at Function.throwIfMissing (/private/tmp/repro/node_modules/web3-core/dist/web3-core.cjs.js:148:13)
at Web3.AbstractWeb3Module (/private/tmp/repro/node_modules/web3-core/dist/web3-core.cjs.js:17:107)
at new Web3 (/private/tmp/repro/node_modules/web3/dist/web3.cjs.js:30:68)
at Object.<anonymous> (/private/tmp/repro/node_modules/truffle-contract/lib/utils.js:7:12)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/private/tmp/repro/node_modules/truffle-contract/lib/execute.js:4:13)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
Awesome! Between this and the PR, these three reproduce methods should be sufficient. Thanks all.
I just opened #1685 to upgrade web3 to latest. This includes pinning the versions. We'll see what Travis says.
FYI for those following along at home: currently planning to start the release process at 4pm ET today (aka 2019-01-30T21:00Z)
@gnidan The PR won't fix the issue. It still has the same error in Travis Ci test.
@filips123 I saw that. @eggplantzzz is working on another PR to pin to beta.37, to give us time to upgrade later.
The beauty is that you have to pin all web3* packages because now there are twenty of them. As if anyone would include anything but the top level web3.
PR to pin to beta.37,
Hmm.... So it was decided that you don't have to go back to beta.33 as it seemed to be suggested above?
@rocky we can't downgrade web3, or we lose support for the new ABI encoder
OK Truffle v5.0.3 has been released. Closing this because I'm an optimist. Let me know if the issue persists and I'll re-open :D
Thanks everyone!
Fix working for me.
Locking to Web3 should be only a temporary solution. Instead, you should make Truffle compatible with newer versions.
Yes, that is right. But the software was not working! Good quick fix. Now one can work on a long term solution.
@Levino Yes, I know that this is a quick fix, so you could now work on a long term solution. You could maybe open another issue for compatibility with new Web3 versions.
Ahem. Or you do it???
Ok. I will create an issue for this.
I created #1690 for compatibility with newer Web3 versions.
@filips123 I saw that. @eggplantzzz is working on another PR to pin to beta.37, to give us time to upgrade later.
[email protected] works for me!
Here is the command:
npm uninstall web3
npm install [email protected]
Most helpful comment
FYI for those following along at home: currently planning to start the release process at 4pm ET today (aka 2019-01-30T21:00Z)