After following a tutorial by JSMastery, I successfully created a portfolio website using Next.js. We also integrated Sentry into our app to allow users to report bugs. Everything was working perfectly fine on my local machine and even after deploying it on Vercel. However, when I accessed the live URL, an error suddenly appeared causing the app to crash. The error message stated "Sentry is not defined."
Error displayed on the screen: Application error: a client-side exception has occurred (check browser console for more information).
Below is the error shown in the console:
137-b94d377c6996f85c.js:446 TypeError: Cannot read properties of undefined (reading 'sentry')
at 396-c590d500d7afd897.js:1:5927
at Array.reduce (<anonymous>)
at X (396-c590d500d7afd897.js:1:5912)
at n (396-c590d500d7afd897.js:1:15030)
at 396-c590d500d7afd897.js:1:151080
at oM (396-c590d500d7afd897.js:1:154196)
at oT (396-c590d500d7afd897.js:1:150126)
at 396-c590d500d7afd897.js:1:149932
at o_ (396-c590d500d7afd897.js:1:149940)
at og (396-c590d500d7afd897.js:1:146805)
at ov (396-c590d500d7afd897.js:1:145377)
at P (396-c590d500d7afd897.js:1:177411)