Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

web3 not connect to meta mask #24

Open
deepprajapati18 opened this issue May 23, 2019 · 4 comments
Open

web3 not connect to meta mask #24

deepprajapati18 opened this issue May 23, 2019 · 4 comments

Comments

@deepprajapati18
Copy link

Screenshot from 2019-05-23 17-59-34

@officialfrancismendoza
Copy link

officialfrancismendoza commented Jun 11, 2019

Came across a similar problem. I tried uninstalling and reinstalling Ganache, because for a separate project, I had a nonce mismatch which prevented me from making any transactions at all. See if that works.

EDIT: At roughly 5:59:00 in the video tutorial, Greg explains that the error is caused when an object parameter is expected and a null value is being passed instead. Also be sure that, if you are using his original code, you downgrade to Truffle v4.1.4 and Solidity v0.4.24

@Madeindreams
Copy link

@fmendoz7

I stumble on this as well. Maybe at the time the video was made the MetaMask connection procedure was not the same. You can look at my pull request that is adding the missing code for MetaMask to connect. However this code will no longer be valid after November 2020 and you will see a warning in the browser dev console about it. This is something I plan on doing to keep my project working after that date. I suspect that the web.3.js and truffle-contract.js will have to be updated as well. I have updated the code to solidity v0.5.16, so this might also change thing a little but I will PR when done and tested.

@D-200021
Copy link

I am getting same error.please can anyone help me please !!

@AnthonyJamez12
Copy link

Jan Kwaitkowski helped me with this issue. I added the function below between the tokensAvailable: 750000, and init: function() { at the top of the app.js file.

initMetaMask: function() {

async function enableUser() {
const accounts = await ethereum.enable();
const account = accounts[0];
App.account = account;
}
enableUser();
},

and this function at the end of app.js

$(function() {
$(window).load(function() {
App.initMetaMask();
App.init();
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants