Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

navEntry.type.replace errors with type undefined #291

Closed
AndersDJohnson opened this issue Dec 8, 2022 · 0 comments · Fixed by #290
Closed

navEntry.type.replace errors with type undefined #291

AndersDJohnson opened this issue Dec 8, 2022 · 0 comments · Fixed by #290

Comments

@AndersDJohnson
Copy link
Contributor

AndersDJohnson commented Dec 8, 2022

We are seeing some errors that appear to come from various browsers, e.g., Chrome 108 on Windows 10, where that navEntry.type isn't defined, such that calling .replace(...) on it is erroring out (

navEntry.type.replace(/_/g, '-') as Metric['navigationType'];
).

Not sure why, as the type property there claims to be supported in that browser: https://developer.mozilla.org/en-US/docs/Web/API/PerformanceNavigationTiming/type#browser_compatibility

Perhaps these are bots that are spoofing user agent and not running in a fully compatible DOM environment.

A fix might look something like this: #290

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant