-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
Package: nextjsIssues related to the Sentry Nextjs SDKIssues related to the Sentry Nextjs SDK
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 package are you using?
@sentry/nextjs
SDK Version
7.24.2
Framework Version
React 18.2.0
Link to Sentry event
No response
Steps to Reproduce
- run
git clone https://github.com/Leo1212/sentry-nextjs-issue.git - run
cd sentry-nextjs-issue - run
yarn - run
yarn run next build - See the result --> error building
- Change in the
package.jsonthe version of@sentry/nextjsto7.16.0 - run
yarn - run
yarn run next build - build --> success
Expected Result
A successful NextJS build.
Route (pages) Size First Load JS
┌ ○ / (394 ms) 4.33 kB 116 kB
├ └ css/ae0e3e027412e072.css 707 B
├ /_app 0 B 112 kB
├ ○ /404 181 B 112 kB
└ λ /api/hello 0 B 112 kB
+ First Load JS shared by all 112 kB
├ chunks/framework-8c5acb0054140387.js 45.4 kB
├ chunks/main-f2e125da23ccdc4a.js 26.7 kB
├ chunks/pages/_app-dfb8b8961ce26b8d.js 38.6 kB
├ chunks/webpack-94547de1949c56d7.js 950 B
└ css/ab44ce7add5c3d11.css 247 B
λ (Server) server-side renders at runtime (uses getInitialProps or getServerSideProps)
○ (Static) automatically rendered as static HTML (uses no initial props)
Done in 14.59s.
Actual Result
The build fails do to the sentry implementation of the _document.tsx file. If you delete ist, it works. But I need this file.
Funny thing is, it worked on the older versions of @sentry/nextjs (7.16.0 and below).
The same issue is also mentioned here: vercel/next.js#36221 (comment)
[= ] info - Generating static pages (0/3)
Error occurred prerendering page "/". Read more: https://nextjs.org/docs/messages/prerender-error
TypeError: Cannot read properties of undefined (reading 'getNonce')
at getInitialProps (file:///pathToRepo/sentry-demo/node_modules/@rest-hooks/ssr/lib/nextjs/RestHooksDocument.js:28:19)
Metadata
Metadata
Assignees
Labels
Package: nextjsIssues related to the Sentry Nextjs SDKIssues related to the Sentry Nextjs SDK