The JavaScript exception "WeakSet key (or WeakMap value) 'x' must be an object or an unregistered symbol" occurs when an value of invalid type is used as a key in a WeakSet or as a value in a WeakMap....add keys that are strings, numbers, or other primitive values...