Skip to content

MetaMask ArrayPrototype Warning

Understanding the console warning

When developing a React application (or any web application), you might encounter this warning in your browser console:

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

This warning indicates that certain JavaScript array methods (toReversed, toSpliced, and toSorted) are being removed from the Array prototype. Developers often mistake this as an issue with their React application code when first encountering it.

Root cause: MetaMask browser extension

Important discovery

The warning does not originate from your React application. It's generated by the MetaMask browser extension as part of its security measures.

MetaMask implements security protocols that monitor and protect against prototype tampering, which is a common attack vector in web applications. When new JavaScript methods get added to the official specification (like ES2023's array methods), MetaMask may initially flag them as potential threats if its internal list of valid methods isn't updated.

Why these specific methods?

The warning targets new immutable array methods introduced in ES2023:

  • .toReversed(): Returns a reversed copy of the array
  • .toSorted(): Returns a sorted copy of the array
  • .toSpliced(): Returns a new array with items spliced without mutation

These methods are now native JavaScript features, but MetaMask's security layer might still consider them as unauthorized modifications to prototypes.

How to identify the source

To confirm MetaMask is the source:

  1. Open your browser's developer tools
  2. Navigate to the Console tab
  3. Execute this command:
js
[].toSorted;

If you see undefined instead of a function definition, it confirms MetaMask has removed the method.

Solution: Safely ignore the warning

For production applications:

  • No action required from your application code
  • The warning is strictly informational and does not impact functionality
  • MetaMask is expected to update their security protocols to recognize these standard methods soon

Solution: Disable MetaMask during development (temporary)

If warnings clutter your development console:

  1. Click the MetaMask extension icon
  2. Choose "This can read and change site data"
  3. Select "On other sites" → Temporarily disable during development
  4. Reload your application - warnings should disappear

Solution: Check for MetaMask updates

Ensure you're running the latest MetaMask version:

  1. Open MetaMask extension
  2. Click account icon → Settings → About
  3. Verify version - issue fixed in v11.3.0+

Confirmed resolution

MetaMask confirmed this was a false positive in their security system. As of v11.3.0 (released June 2023), this warning no longer appears when using updated extension versions.

Additional context

This security mechanism exists to prevent malicious websites from hijacking or modifying core JavaScript functionality in users' browsers. When MetaMask detects "new" methods that weren't in the original ECMAScript specification they used as a baseline, they remove them and log a warning.

You can track related issues on MetaMask's GitHub repository:

md
[#11900](https://github.com/MetaMask/eth-phishing-detect/issues/11900)  
[#12200](https://github.com/MetaMask/metamask-extension/issues/12200)

Conclusion

The Removing intrinsics.%ArrayPrototype% warnings occur when:

  1. You have MetaMask browser extension installed
  2. Your browser supports ES2023 array methods
  3. MetaMask's security layer mistakenly flags standard methods

No code changes are needed in your React application. As JavaScript standards evolve, ensure both your browser and extensions stay updated. For development, disable MetaMask or update it to latest version to suppress these warnings.