I am trying to make ethereum-electron-react application.

when I try to inject web3 it does not get detected.

import Web3 from 'web3';

console.log (Web3);

this shows an empty object

enter image description here even though I have already installed Web3.

node version -v8.9.4

enter image description here

enter image description here

any ideas to fix it?

  • Manish, How do you figure out how to create an electron ethereum app? Do you happen to have a guide or tips? Thank you!
    – march_f6
    Oct 4, 2018 at 13:08
  • I don't think that replying the question with a question is a good practice (in this situation). If you have a specific question it would be better to ask it separately.
    – Aquila
    Oct 4, 2018 at 19:04

1 Answer 1


I believe the problem is how the electron app runs. It is serving content from the local storage.

Web3 will be injected only if the page was server from a web server:

MetaMask Compatibility Guide

Http(s) - Web Server Required

Due to browser security restrictions, we can't communicate with dapps running on file://. Please use a local server for development.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.