Closed judeProground closed 4 days ago
I discovered that this error is caused by a conflict with the web3modal/wagmi-react-native package, as highlighted in the Sentry stack trace. I disabled the wagmi configuration and web3modal initialization, and then metamask-sdk worked.
I think I should try wagmi v1 MetaMaskConnector to use both web3modal and metamask-sdk
HI @judeProground ! We recently updated the MetaMask connector on Wagmi, can you give it a try with the latest version?
Hi @judeProground we're closing this issue for the time being. If you still experience this issue please feel free to give us a ping so that we can reopen.
Having a similar issue with the latest version of wagmi connector in a Next.JS app maybe it's a different problem but I landed here after googling "Metamask privateMap.get is not a function"
Here's the error I get on the terminal running next dev
(via a pnpm dev
script)
web:dev: TypeError: privateMap.get is not a function
web:dev: at __classPrivateFieldGet (/Users/user/app/node_modules/.pnpm/tslib@1.14.1/node_modules/tslib/tslib.js:250:27)
web:dev: at Dg.push (/Users/user/app/node_modules/.pnpm/@metamask+sdk@0.26.4_react-dom@18.2.0_react-native@0.74.3_react@18.2.0/node_modules/@metamask/sdk/node_modules/@metamask/json-rpc-engine/dist/JsonRpcEngine.js:85:9)
web:dev: at forEach (/Users/user/app/node_modules/.pnpm/@metamask+sdk@0.26.4_react-dom@18.2.0_react-native@0.74.3_react@18.2.0/node_modules/@metamask/sdk/node_modules/@metamask/providers/dist/chunk-OGPA5Q76.mjs:62:53)
web:dev: at Array.forEach (<anonymous>)
web:dev: at new super (/Users/user/app/node_modules/.pnpm/@metamask+sdk@0.26.4_react-dom@18.2.0_react-native@0.74.3_react@18.2.0/node_modules/@metamask/sdk/node_modules/@metamask/providers/dist/chunk-OGPA5Q76.mjs:62:19)
web:dev: at new super (/Users/user/app/node_modules/.pnpm/@metamask+sdk@0.26.4_react-dom@18.2.0_react-native@0.74.3_react@18.2.0/node_modules/@metamask/sdk/node_modules/@metamask/providers/dist/chunk-UTROHXPT.mjs:36:5)
web:dev: at new super (/Users/user/app/node_modules/.pnpm/@metamask+sdk@0.26.4_react-dom@18.2.0_react-native@0.74.3_react@18.2.0/node_modules/@metamask/sdk/node_modules/@metamask/providers/dist/chunk-URMSZO7Z.mjs:46:5)
web:dev: at new Iw (/Users/user/app/node_modules/.pnpm/@metamask+sdk@0.26.4_react-dom@18.2.0_react-native@0.74.3_react@18.2.0/node_modules/@metamask/sdk/src/provider/SDKProvider.ts:51:5)
web:dev: at new Py (/Users/user/app/node_modules/.pnpm/@metamask+sdk@0.26.4_react-dom@18.2.0_react-native@0.74.3_react@18.2.0/node_modules/@metamask/sdk/src/services/Ethereum.ts:24:22)
web:dev: at Function.init (/Users/user/app/node_modules/.pnpm/@metamask+sdk@0.26.4_react-dom@18.2.0_react-native@0.74.3_react@18.2.0/node_modules/@metamask/sdk/src/services/Ethereum.ts:68:21)
web:dev: at /Users/user/app/node_modules/.pnpm/@metamask+sdk@0.26.4_react-dom@18.2.0_react-native@0.74.3_react@18.2.0/node_modules/@metamask/sdk/src/provider/initializeMobileProvider.ts:101:29
web:dev: at Generator.next (<anonymous>)
web:dev: at p (/Users/user/app/node_modules/.pnpm/@metamask+sdk@0.26.4_react-dom@18.2.0_react-native@0.74.3_react@18.2.0/node_modules/@metamask/sdk-communication-layer/dist/node/es/metamask-sdk-communication-layer.js:1:68682)
web:dev: [MetaMaskSDK: constructor()] error during initialization TypeError: privateMap.get is not a function
@Mouradif, could you please update to the latest version of the SDK and try again? We’ve updated some internal packages, and we believe this should resolve the issue.
Hi all! I'll be closing this issue since there hasn't been activity on it for a while. Please feel free to open it again if it still applies.
SDK
React-Native
Provide environment information
react-native 0.72
MetaMask SDK Version
0.18.5
MetaMask Mobile app Version
not important
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
Describe the Bug
Hi, I'm trying to integrate
@metamask/sdk-react
to react-native app.I'm following examples below
Since the official documentation and examples mentioned above are not quite updated, I need some advice. I lost track at Ethereum.init and have no idea what 'privateMap' refers to. Here are the logs below.
Expected Behavior
SDK Init
Link to reproduction - Issues with a link to complete (but minimal) reproduction code will be addressed faster
No response
To Reproduce