RangeError: form must be one of 'NFC', 'NFD', 'NFKC', or 'NFKD'
The JavaScript exception "form must be one of 'NFC', 'NFD', 'NFKC', or 'NFKD'" occurs when an unrecognized string is passed to theString.prototype.normalize() method.
In this article
Message
RangeError: The normalization form should be one of NFC, NFD, NFKC, NFKD. (V8-based)RangeError: form must be one of 'NFC', 'NFD', 'NFKC', or 'NFKD' (Firefox)RangeError: argument does not match any normalization form (Safari)
Error type
RangeErrorWhat went wrong?
TheString.prototype.normalize() method only accepts the following four values as itsform argument:"NFC","NFD","NFKC", or"NFKD". If you pass any other value, an error will be thrown. Read the reference ofnormalize() to learn about different normalization forms.
Examples
>Invalid cases
js
"foo".normalize("nfc"); // RangeError"foo".normalize(" NFC "); // RangeErrorValid cases
js
"foo".normalize("NFC"); // 'foo'