Skip to content

Downloaded dapp calling eth accounts won't work (Pizza) #392

@filippsen

Description

@filippsen

Environment/Browser

1.6.1.
Still valid on version 1.7.0

Description

Downloaded Pizza template Dapp won't work. This appears to be related to the missing enable call to MetaMask, to allow accessing injected MetaMask accounts.

Steps to reproduce

  1. Create a new project from the CryptoPizza template
  2. Set Ropsten network (in Select a Network button) or any other external network
  3. Deploy CryptoPizza.sol
  4. Open Preview panel
  5. Click Download DApp button
  6. Run the downloaded html file locally
  7. Observe Browser Console error

Expected result

Expected it to work just like Preview.

Actual result

jquery.js:3827 Uncaught TypeError: Cannot read property 'eth' of undefined

Line is: window.web3.eth.accounts[0].

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions