0

So everything worked fine in truffle 4.1.14, but when I upgraded to 5.0.0 I got this error:

TypeError: source.setEngine is not a function
  at Web3ProviderEngine.addProvider (node_modules/web3-provider-engine/index.js:71:10

I'm using this require:

const ProviderEngine = require('web3-provider-engine')

And this is the code that is cusing the error:

var engine = new ProviderEngine()

 engine.addProvider(web3.currentProvider)

Is it a bug with web3 provider engine? Any help would be great thanks!

  • Truffle 5 has upgraded web3 version from 0 to 1. – goodvibration Jan 31 at 21:38
  • But its web3-provider-engine thats failing not web3? – Mark Oland Feb 2 at 18:42

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.