Commit 7a975c9
fix(web-vitals): Add error handling for invalid object keys in
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.
Closes #18810 (added automatically)
Co-authored-by: Nicolas Hrubec <[email protected]>WeakMap (#18809)1 parent ca02322 commit 7a975c9
File tree
1 file changed
+11
-3
lines changed- packages/browser-utils/src/metrics/web-vitals/lib
1 file changed
+11
-3
lines changedLines changed: 11 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
27 | 35 | | |
28 | | - | |
| 36 | + | |
29 | 37 | | |
0 commit comments