A customer experienced the following issue on iOS Safari 18.6.2: TypeError: WeakMap keys must be objects or non-registered symbols.
The culprit is probably in web vitals initUnique function (which is vendored in).
This fix adds a try/catch to handle edge cases where invalid keys are passed to WeakMap, returning a new instance without caching when validation fails.
Note
The pull request "fix(web-vitals): Add error handling for invalid object keys in
WeakMap" was created by @s1gr1d but did not reference an issue. Therefore this issue was created for better visibility in external tools like Linear.A customer experienced the following issue on iOS Safari 18.6.2:
TypeError: WeakMap keys must be objects or non-registered symbols.The culprit is probably in web vitals
initUniquefunction (which is vendored in).This fix adds a try/catch to handle edge cases where invalid keys are passed to WeakMap, returning a new instance without caching when validation fails.