-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Collecting page data ...TypeError: Cannot read property 'getInitialProps' of undefined #5978
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi, thanks for writing in and providing a reproduction example. It helped a lot in debugging this. There was indeed a bug in our logic with the I opened #5984 to fix this. |
Hi @lforst, unfortunately I'm experiencing this issue too. Version: 7.22.0 (7.21.1 didn't work either) Repository setup:
Contents of const { withSentryConfig } = require('@sentry/nextjs');
const moduleExports = {
sentry: {
hideSourceMaps: true,
},
};
const sentryWebpackPluginOptions = { silent: true };
module.exports = withSentryConfig(moduleExports, sentryWebpackPluginOptions); Running
From what I can see, the patch referenced on this issue should wrap either pages underneath |
@joelbiffin Thanks for reporting this! Would you be able to provide a reproduction example? It's hard debugging this from the information you shared. |
Thanks @lforst for getting back so quickly! So, after digging through a few more of the Github Issues, it looks like there is already an open issue here. I tried reproducing the issue from Notably though, downgrading to 7.12.1 resolved the build issue as some of the commenters on vercel/next.js#36221 suggest. |
Jumping in on this one. I experienced same issue with Next From my project's perspective, quick solution was to rename the Check out my comment in Next.js GH thread for more info. In addition, I took a quick glimpse at the same file ( normalizedAbsoluteResourcePath.startsWith(pagesDirPath) && which matches all folders starting with Since I haven't heard that Next discourages creation of custom folders that start with the name Hope that was helpful! |
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which package are you using?
@sentry/nextjs
SDK Version
7.15
Framework Version
No response
Link to Sentry event
No response
Steps to Reproduce
clone https://github.com/a-ursino/nextjs-sentry-bug
yarn
yarn build
Verify errors in the build output.
However if I don't import the content of the homepage from
src/pages/Homepage
and just inline it inpages/index.ts
everything works fine.If I disable sentry from
next.config.js
, I can still import the content fromsrc/pages/Homepage
and the build works fine.NOTE:
I've created the example website with
npx create-next-app@latest
npx @sentry/wizard -i nextjs
Expected Result
build to succeed
Actual Result
The text was updated successfully, but these errors were encountered: