Skip to content
JS
JavaScript error

TypeError

The JavaScript exception "TypeError: matchAll/replaceAll must be called with a global RegExp" occurs when the String.prototype.matchAll() or String.prototype.replaceAll() method is used with a RegExp object that does not have the global flag set.

Reference entryJavaScriptFetched
TypeError: String.prototype.matchAll called with a non-global RegExp argument (V8-based)
As listed by MDN Web Docs
TypeError: String.prototype.replaceAll called with a non-global RegExp argument (V8-based)
As listed by MDN Web Docs
TypeError: matchAll must be called with a global RegExp (Firefox)
As listed by MDN Web Docs
TypeError: replaceAll must be called with a global RegExp (Firefox)
As listed by MDN Web Docs
TypeError: String.prototype.matchAll argument must not be a non-global regular expression (Safari)
As listed by MDN Web Docs
TypeError: String.prototype.replaceAll argument must not be a non-global regular expression (Safari)
As listed by MDN Web Docs
Category
TypeError
Severity
error
Runtime
both
or press Cmd/Ctrl + Enter. The text is only sent to this site to match it.
Source: MDN Web Docs. Data fetched 2026-09-25T01:48:37.274Z.