I am trying to implement Gnosis into a react Webapp with using metamask as provider. Upon following the Setup Tutorial i stumbled on this error:
Safe.ts:164 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'getChainId')
My component is as follows:
import Safe, { SafeFactory, SafeAccountConfig } from '@gnosis.pm/safe-core-sdk'
const web3Provider = window.ethereum;
const provider = new ethers.providers.Web3Provider(web3Provider)
const safeOwner = provider.getSigner(0)
const ethAdapter = new EthersAdapter({
ethers,
signer: safeOwner
})
const createSafe = async () =>{
const safeFactory = await SafeFactory.create({ ethAdapter });
const safeSdk = await safeFactory.deploySafe({ safeAccountConfig });
safeSdk();
}