What Is Causing the Warning 'Removing Intrinsics. %Arrayprototype%. toReversed' in React?

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.

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: 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.

5

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.

Maya Lin-Takahashi

Maya Lin-Takahashi

Consumer Tech & Gadget Reviewer

Maya is a hardware enthusiast who tests and reviews smart home devices, smartphones, wearables, and audio gear. She focuses on practical consumer value and build quality.

Share this article
Twitter Facebook Pinterest