Skip to content

Uncaught TypeError: web3.eth is undefined (web3auth.js) #9

@WP-LKL

Description

@WP-LKL
  • Django-Web3-Auth version: 0.1.6
  • Django version: 2.0.6
  • Python version: 3.8.10
  • Operating System: WSL

Description

Run example demo

What I Did

I followed the example README.md.

Running server logs the following in console when attempting to click login:
Uncaught TypeError: web3.eth is undefined
checkWeb3 http://localhost:8000/static/web3auth/js/web3auth.js:56
startLogin http://localhost:8000/login/:88
onclick http://localhost:8000/login/:1
web3auth.js:56:5

// web3auth.js
function checkWeb3(callback) {
    // web3 = new Web3(window.ethereum)
    web3.eth.getAccounts(function (err, accounts) { // Check for wallet being locked
        if (err) {
            throw err;
        }
        callback(accounts.length !== 0);
    });
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions