node-metamask
node-metamask copied to clipboard
Metamask crashes after the connector starts
I'm trying to authenticate transactions using metamask. I execute the following code but once I connect to page localhost:3333, MetaMask plugin crashes. It tries to show me the transaction notification but then goes blank.
async function connectToMetamask() {
const connector = new MetaMaskConnector({
port: 3333,
onConnect() {
console.log('MetaMask client connected')
},
});
// Now go to http://localhost:3333 in your MetaMask enabled web browser.
console.log("Go to http://localhost:3333");
await connector.start();
const web3 = new Web3(connector.getProvider());
// Use web3 as you would normally do. Sign transactions in the browser.
CampaignContract.setProvider(connector.getProvider());
}