96

I am getting following warning on first load of my App.

lockdown-install.js:1 Removing intrinsics.%ArrayPrototype%.toReversed
intrinsics.%ArrayPrototype%.@@unscopables.toSpliced
intrinsics.%ArrayPrototype%.@@unscopables.toSorted

I really have no idea what this is about, so there's nothing that I have previously tried.

I went into the node_modules to try and find something related to it... been searching on the internet and even chatGPT but the information that I found is vague.

Drew Reese
  • 165,259
  • 14
  • 153
  • 181
Kvz
  • 1,141
  • 1
  • 3
  • 9

3 Answers3

183

I randomly started getting this in my project right around the time you made this post which was odd.

Do you have Metamask installed as a browser extension? I disabled the extension and the warnings went away.

I found this post: https://github.com/MetaMask/eth-phishing-detect/issues/11900 Which potentially suggests that something in our projects are triggering metamasks anti-phishing feature somehow? Not quite sure, but disabling the extension removed the warnings and confirmed it wasn't something in my app directly.

Jdelacrix
  • 1,806
  • 1
  • 3
  • 5
19

Warning is coming from MetaMask Chrome Extension, not your React app.

It seems that MetaMask checks native prototypes in its environment to see if they have been mutated or tampered with, as a security measure.

With ES2023, some native prototypes have gained new methods, such as toSorted, toReversed, etc. It looks like MetaMask is not updated to know about these, so it thinks the native prototypes are mutated or changed. Basically, MetaMask just removes these "unknown" methods from the prototypes and then logs about it on the console.

If you go and inspect your MetaMask extension popup and write [].toSorted in the console, you will get undefined because MetaMask has removed them since it doesn't recognize them.

You don't have to do anything, you can just ignore them for now until MetaMask updates.

Shiba
  • 330
  • 1
  • 5
5

I found what is causing this issue -- poor quality of Metamask extension and speed of turtle when their is trying to address an issue.

BitOfUniverse
  • 5,903
  • 1
  • 34
  • 38