analytics icon indicating copy to clipboard operation
analytics copied to clipboard

Problem with android 10 and android 13

Open lougraveflex opened this issue 2 years ago • 1 comments

Just want to start this off by saying, this package is fantastic and I appreciate all of the hard work you folks have put into it! It works really well!

I am using this package for a production website and I have sentry.io set up on the project. In our sentry logs we noticed that in Chrome (v110) on the Android 10 and Android 13 operating systems, and only those operating systems, we get this error:

./node_modules/@analytics/url-utils/dist/analytics-util-url.module.js in analytics_util_url_module_y at line 2:1
TypeError
Cannot read properties of null (reading '0')

It seems to be an error in a dependency of this package, and again we get events perfectly in every other environment so we don't think there is a problem with our setup of this package. We threw all of our analytics function calls into try/c blocks and stopped seeing instances of this error. :)

Just wanted to let you know, and thanks for your time!

PS. If there is any additional information I can provide, please do let me know! I'll do what I can to get you anything you need.

lougraveflex avatar Mar 27 '23 18:03 lougraveflex

Hey there. Thanks for the report. This is a weird one

The package source code is here https://github.com/DavidWells/analytics/blob/master/packages/analytics-util-url/src/index.js

Are you using the https://github.com/DavidWells/analytics/tree/master/packages/analytics-util-visitor-source plugin by chance? It's possible a null value is being passed thru to one of these function calls https://github.com/DavidWells/analytics/blob/master/packages/analytics-util-visitor-source/src/utils/parse-referrer.js#L2-L9

DavidWells avatar May 27 '23 21:05 DavidWells

Closing. Let me know if you still have issue or any additional context

DavidWells avatar Feb 11 '24 23:02 DavidWells