metamask-extension
metamask-extension copied to clipboard
[Bug]: BRAVE browser - Cannot assign to read only property 'chainId' of object
Describe the bug
I first detected this behavior on my Angular app, but I've noticed that it happens in other sites, like:
- https://rinkeby.etherscan.io/.
- https://ethernaut.openzeppelin.com/
- https://faucets.chain.link/
When I just get in one of these websites, a error log is shown at console:
inpage.js:1 Uncaught (in promise) TypeError: Cannot assign to read only property 'chainId' of object '#<l>'
at l._handleChainChanged (inpage.js:1:39117)
at l._handleChainChanged (inpage.js:1:46662)
at l._handleChainChanged (inpage.js:1:44260)
at l._initializeState (inpage.js:1:37927)
at l._initializeStateAsync (inpage.js:1:46258)
In case of ethernaut.openzeppelin.com and fauctes.chain.link, this one is also shown:
Uncaught (in promise) TypeError: Cannot assign to read only property 'selectedAddress' of object '#<l>'
at l._handleAccountsChanged (inpage.js:1:39788)
at r (inpage.js:1:38276)
at o._handle (inpage.js:17:2422)
I disabled all extensions in my Brave browser
Steps to reproduce
- Just access https://faucets.chain.link/ with Brave browser
- Show console and the error message is there
Error messages or log output
inpage.js:1 Uncaught (in promise) TypeError: Cannot assign to read only property 'chainId' of object '#<l>'
at l._handleChainChanged (inpage.js:1:39117)
at l._handleChainChanged (inpage.js:1:46662)
at l._handleChainChanged (inpage.js:1:44260)
at l._initializeState (inpage.js:1:37927)
at l._initializeStateAsync (inpage.js:1:46258)
Uncaught (in promise) TypeError: Cannot assign to read only property 'selectedAddress' of object '#<l>'
at l._handleAccountsChanged (inpage.js:1:39788)
at r (inpage.js:1:38276)
at o._handle (inpage.js:17:2422)
Uncaught TypeError: Cannot assign to read only property 'chainId' of object '#<l>'
at l._handleChainChanged (inpage.js:1:39117)
at l._handleChainChanged (inpage.js:1:46662)
at l._handleChainChanged (inpage.js:1:44260)
at s.<anonymous> (inpage.js:1:45866)
at i (inpage.js:1:56067)
at s.emit (inpage.js:1:56607)
at inpage.js:1:55131
at d.write [as _write] (inpage.js:1:55154)
at w (inpage.js:17:29867)
at inpage.js:17:33045
Version
10.18.0
Build type
No response
Browser
Brave
Operating system
Linux
Hardware wallet
No response
Additional context
Brave version: 1.42.86 Chromium: 104.0.5112.81 I have other extensions installed on Brave but all of them are disabled but Metamask
I've done the same access with the same computer using Firefox 103.0.1 (Metamask plugin 10.18.1) and the error message is not shown at console.
Also seeing this error message on Brave, more specifically both chainId
errors.
On my end this is the case on all sites (including GitHub right now). Updated the extension and no dice. I also have no other extensions installed.
From basic use it does not seem to impact the extension's usage, but it is quite... annoying.
For context, I am on Windows, same brave version as above.
Same problem here! On Brave and Windows as well.
In retrospect, this is most likely a Brave issue, not a MetaMask issue - setting the default wallet to None
on brave://settings/wallet
seems to avoid the error.
I would also like to add that because of this type error you can't open google docs with metamask installed. Nontheless, the coment above solves the issue.
I would also like to add that because of this type error you can't open google docs with metamask installed. Nontheless, the coment above solves the issue.
Wow! I had a problem earlier opening a google spreadsheet but I did't link the facts. I've followed the @Ncookiez suggestion and it worked. Thanks!
I would also like to add that because of this type error you can't open google docs with metamask installed. Nontheless, the coment above solves the issue.
Same problem here, I couldn't open a google doc earlier, but I hadn't related it to Brave. Also Storybook and Next.js was showing me this error on every render. Thank you @Ncookiez , your suggestion works for me 💯
@Ncookiez You are a genius! I was just getting stuck with it showing up while developing a Next.js app. It works now. Thanks!
I also confirm this error. For now using @Ncookiez suggestion.
Yaa had the same error but followed @Ncookiez suggestion and it worked. Thanks @Ncookiez
Thank you so much @Ncookiez, I had been banging my head to the wall for a whole day before this!
I'm facing the same issue, setting the default wallet on Brave is solved as well (thank you so much @Ncookiez). I'm curious if it's just a Brave issue or maybe related to the wallet integration. It's happening for me using wagmi with metamask connector (https://wagmi.sh/docs/connectors/metaMask), curious about if it's happening for all JS connectors.
Hey all, this is a Brave issue, they have a pending PR to fix here: https://github.com/brave/brave-core/pull/14483
@Ncookiez Thank you!!! You saved me so much time :)
In retrospect, this is most likely a Brave issue, not a MetaMask issue - setting the default wallet to
None
onbrave://settings/wallet
seems to avoid the error.
Wow and this is why I reinstalled my browser & went to all this trouble trying to debug the issue on my nextjs app 🤦🏻 & imported metamask wallets multiple times.... Nevertheless thanks mate.
FWIW - I am not sure if it is related, but I had this same issue sowing up after enabling Media Router
to cast from the browser. Again, I am not sure if it is related, but I figured I should share.
Thanks for the fix @Ncookiez! Also, not sure if related or not, but could not use metamask with remix today, had to use another browser at some point.
Facing the same issue still.
Facing the same issue still.
try to update Brave browser
I've had pending updates for the brave browser, after update, everything seems like before!
Issue still occurs for me. Was building a next.js app with typescript. Works fine in Chrome.
Brave version: Version 1.42.86 Chromium: 104.0.5112.81 (Official Build) (64-bit)
Tried updating brave. Not sure why this happened all of a sudden.
Looks like Brave merged a fix for this 5 days ago. Not sure when it'll be released though. It's best to follow up directly on their repo: https://github.com/brave/brave-core/pull/14483
fabianorodrigo
i had to use multiple browsers for different purpose and it really sucks
brave/brave-core#14483
This error seems to be gone with release v1.42.97 (Aug 17th, 2022)
This error seems to be gone with release v1.42.97 (Aug 17th, 2022)
Closing the issue as it was reported the fix has been released by Brave. Thank you all for following up on this!