Here are the black cordevite stats based on your description:
MetaMask: Ether.js Perspective on Descotope, but no Mobil MetaMask
As a DAPP slacker I ran into a few issues using full form metamask for misery with my Smart Contraction Ethereum. At this point I will be putting my own fix in Metamask as a desktop and on mobile.
Problem:
My problem started when I decided to use MetaMask on Android and iOS devices to connect to the main connection of my Dapp Biblothecus Ether.js. Imagining that everything was working normally, but only if I installed MetaMask on my Android or iOS device, I got stuck with a spoon.
Error:
Usually coexisting obese looks like this:
TypeError: Cannot read property
default'' of undefined''
Or is it like the reasons for this, like MetaMask at the base of your Dapp's connection. This problem, decreasing, occurs even when the Ether.js library works on my own calculation.
Resolution:
After some trials and skewers, I fell that this problem occurs from this, because MetaMask sticks to thedefault
objeys web3, echo ether.js.
To solve this problem, I have two potential resolutions:
- Using the second post: One of the resolutions - echo from using Ether.js for MetaMask to the second post, for example. These libraries impress the greater control over the Post -Web3 post and perhaps less corrected, combined with their own
default''.
- Find thedefaultProvider
parameter in Ether.js: ** Mestation-Set the Parameter
DefaultProviderin the Ether.js Library, which can redirect anyone.
To include these solutions, you need to change the connection code in the base network of your DAPP, use one with the following methods:
Resolution 1: Use the second provider (Truffle.js or Hardhat)
JavaScript
Const web3 = require(‘web3’);
Const ethers = require(‘ethers’);
Const provider = new ethers.providers.web3provider();
provider.setBlockchian(‘mainnet’); // Install the mainnet provider
Const contract = new Ethers.Contract(ContractDress, ABI);
`
Resolution 2: Install the defaultProvider
parameter in Ether.js
`JavaScript
Const web3 = require(‘web3’);
Const ethers = require(‘ethers’);
Const provider = new ethers.providers.web3provider();
provider.setBlockchian(‘mainnet’, {
DefaultProvider: ‘
});
`
Visible:
Well, MetaMask can be connected to the mainnet of my dapp ether.js, I was two potential resolutions that were captured by this problem. These resolutions constantly change the code of your DAPP with one-time methods.
In the case of these resolutions, you can opt out of MetaMask to work as desktops, so on mobile devices to connect your smart contract with Ethereum Ether.js.
NOTE: This is all the time paths that may not be the most effective resolution. I recommend other options for resolutions to this problem or consulting a professional breakup if necessary.
Leave a Reply