-
Notifications
You must be signed in to change notification settings - Fork 427
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
TypeError: Cannot read properties of undefined (reading 'processingEnd') #496
Comments
We've had another report of this too and are investigating. Can you confirm:
|
And all those browser are seeing this issue? |
yes! This is the spread that's reporting this error specifically |
How common is this do you know? And would you be able to run a custom build to help us track it down? |
About 5% of our users seem to experience it, and yes, I can run a custom build |
We released a debug version here: https://unpkg.com/web-vitals@4.2.0-debug.0/dist/web-vitals.attribution.js You should be able to install using We basically added the below code. It will still cause an error (but this time by explicitly raising an exception) as we haven't fixed the issue, but we're hoping it will give us more information in that exception when that happens. There is also a chance this issue is fixed as we refactored some of this code. So if you do not see errors with this code then you can try the latest production version ( Let us know how you get on and if you could share some error messages we can look further. if (!group) {
// @ts-ignore
const obj = {
reportTime: performance.now(),
navigationType: metric.navigationType,
entries: metric.entries.map((e) => {
return Object.assign({interactionId: e.interactionId}, e.toJSON());
}),
value: metric.value,
delta: metric.delta,
};
// This should never happen, so throw an error to figure out why.
throw new Error(`Missing group: ${JSON.stringify(obj)}`);
} |
Quick clarification, the most recent changes from #495 have not yet been released into any stable version, but we think there's a chance they might fix (or at least improve) the issue. So if you try out the |
Thanks! I've submitted the PR on my side and expect it to go out in the morning |
Any update @nordfjord ? did the patch go out and are you still seeing the errors? |
@tunetheweb, patch went out yesterday and I've not seen the error yet, keeping an eye out and will let you know how if that changes |
Happy to report I've not seen this error crop up in the last 2 days. So I think it's safe to mark as fixed and cut a release for 4.2.0! |
FYI we released 4.2.0 yesterday. Thanks for your help with testing! |
We're getting an error in production because
group
is undefinedI took a quick look at the code and it seems like it's related to this piece of code
web-vitals/src/attribution/onINP.ts
Line 245 in 9ef3307
Map#get
returnsT | undefined
and it's being marked as non-nullable in the code. In production we're definitely hitting the case of it returning undefined. Maybe a proper null check is in order?The text was updated successfully, but these errors were encountered: