Repository navigation
Seeing an occasional ReferenceError: globalThis is not defined #58818
Replies: 6 comments 5 replies
|
@mauricedb Hi! I'm receiving this errors too, but do you know if they're actually errors? I mean, the app is still working or not? Because I can't understand how to fix them and I don't know if they're breaking my app or not, thanks! |
|
@Emiliano-Bucci I am not sure, I believe the app is still working based on the Sentry replays but as I don't have a Pixel 2 or similar old device it's hard to be certain. |
|
@mauricedb, I also get this in Sentry as well. Initially it was being caused by ByteSpider which is a crawler and I was getting 300+ users impacted. I blocked Sentry from reporting if it's ByteSpider to reduce the noise as it was causing me to go over my free tier usage. However, I am now seeing this again with the referrer being |
|
We're seeing this in our Sentry logs too, all errors so far have originated from |
|
Same error on Chrome 66. My stack trace calls out MDN indicates globalThis support from chrome 71+, while nextjs docs state support for chrome 64+. I tried adding a polyfill that gets imported as the first import in the root layout (App Router), but the error is thrown before the polyfill code runs π€· Curious if something like this PR or this PR might fix it, but the steps to setup local development prevent me from testing this easily. |
|
For anyone seeking for a solution to this, I fix it by adding this script inside head tag inside Root Layout: @karlkeefer FYI |
Uh oh!
There was an error while loading. Please reload this page.
I am getting the occasional error
ReferenceError: globalThis is not definedin my Sentry logs.These mostly seem to come from a Pixel 2 Android device although I have also seen from other devices like:
As these are all old browsers I was wondering if there is a recommended polyfill I can use to fix these errors?
The JSON export from Sentry
All reactions