I have a meteor app and would like to use web3 on the server. Wneh I call a web3 function I always get the following error:

TypeError: XMLHttpRequest is not a function

What do I have to do, that I can call web3 functions from the server?

Thanks for your help

  • How are you using web3? Does this helps ethereum.stackexchange.com/questions/1212/… ? – Ismael Jun 25 '17 at 22:21
  • I'm running testrpc on the server and want to use web3. In Meteor.methods() I have a function which should write data to the contract which I deployed on testrpc. I did the following: import { Web3 } from 'meteor/ethereum:web3' if (typeof web3 !== 'undefined') { web3 = new Web3(web3.currentProvider); } else { web3 = new Web3(new Web3.providers.HttpProvider("localhost:8545")); }; and when I call console.log(web3.eth.accounts); I get then error message above – Bumblebee Jun 26 '17 at 13:23
  • Bumblebee can you provide your code? – Rafid Sep 2 at 12:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.