Repository navigation
Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/browser
SDK Version
7.73.0
Framework Version
No response
Link to Sentry event
No response
SDK Setup
No response
Steps to Reproduce
Call Sentry.captureException
Expected Result
Exception to be reported to Sentry
Actual Result
crypto.getRandomValues returns undefined, hence
| getRandomByte = () => crypto.getRandomValues(new Uint8Array(1))[0]; |
throws an error:
TypeError: Cannot read properties of undefined (reading '0')
This is something I already tracked in other closed issues like:
I'm aware in those cases it looked like it was due to a polyfill implementation issues. Besides, the sentry package that was provided in the issue was @sentry/node.
However in this case, I noticed this issue by using @sentry/browser in an old Chromium version: 23.0.1235.0 (151422).
In fact, just executing crypto.getRandomValues(new Uint8Array(1)) in Chrome DevTools console, it returns undefined.
The typed array is updated anyways, the only problem is this particular implementation of getRandomValues doesn't return the typed array:
I think it might be possible that other old browser engines and versions are affected by this issue but, unfortunately, I have not been able to check it yet.
Metadata
Metadata
Assignees
Labels
Projects
- StatusShow more project fieldsNo status


Activity
Lms24 commentedon Oct 16, 2023
Hi @jghinestrosa thanks for writing in and for opening the PR to fix it. Already left a review there.
Normally I'd agree that this should be polyfilled but since the fix appears rather simple, I think it's fine if we fix it on our end.
Lms24 commentedon Oct 16, 2023
FYI, just assigning myself to this issue for us internally since I've been reviewing it.
AbhiPrasad commentedon Dec 19, 2023
Fix released with https://github.com/getsentry/sentry-javascript/releases/tag/7.89.0 - thanks for the PR @jghinestrosa!