If parseMeasurement returns null, look for these causes:
- The unit isn't supported. See Supported units.
-
The text doesn't say whether it is a height or a weight. Set
type. -
A number has no unit. Set
defaultUnitto the source unit shown by the field. -
A unit name has a spelling error. Set
fuzzy: trueto read one error. - The text has a range, duplicate measurements, an incomplete fragment or unsupported text. See Limits.
-
The input isn't a string. Non-string input returns
nullat runtime; the TypeScript parameter remainsstring. -
The raw
input.length, before trimming, exceedsmaxLength(default 1,000). Set a largermaxLengthorInfinityfor no limit. Length counts UTF-16 code units, as JavaScript does.