-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Out of memory when building NextJS application with sentry #13836
Comments
Assigning to @getsentry/support for routing ⏲️ |
Hi @ricardomatias, does the build succeed locally without problems? Could you paste your next config here? |
The issue in the context that I created is still there, but I've managed to get to a stage where I can build the application (albeit it's very slow). I recall disabling sourcemaps was the first change which resulted in a successful build. Now it works even with sourcemaps, but I cant recall all the steps I took during that journey. This is my next config at the moment, which works: const nextConfig = {
webpack: (config, options) => {
config.module.rules.push({
test: /\.html/,
use: [
options.defaultLoaders.babel,
{
loader: 'html-loader',
},
],
})
return config
},
experimental: {
instrumentationHook: true,
serverActions: {
bodySizeLimit: '10mb',
},
},
};
export default withSentryConfig(withNextIntl(nextConfig), {
// For all available options, see:
// https://github.com/getsentry/sentry-webpack-plugin#options
org: "XXXX",
project: "XXXX",
telemetry: false,
// Only print logs for uploading source maps in CI
silent: false,
// For all available options, see:
// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/
// Upload a larger set of source maps for prettier stack traces (increases build time)
widenClientFileUpload: false,
// Route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers.
// This can increase your server load as well as your hosting bill.
// Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client-
// side errors will fail.
tunnelRoute: "/monitoring",
sourcemaps: {
disable: true
},
// Hides source maps from generated client bundles
hideSourceMaps: true,
// Automatically tree-shake Sentry logger statements to reduce bundle size
disableLogger: true,
// Enables automatic instrumentation of Vercel Cron Monitors. (Does not yet work with App Router route handlers.)
// See the following for more information:
// https://docs.sentry.io/product/crons/
// https://vercel.com/docs/cron-jobs
automaticVercelMonitors: false,
}); |
From what I've seen other users report is that memory consumption with sourcemaps enabled always seems to hover around 4GB, it could be that you get lucky with some builds even when sourcemaps are enabled. |
Try setting Additionally, you may find that setting an explicit As an aside: you will likely benefit from setting |
@m-sanders that is some great input. Thank you very much! |
Environment
SaaS (https://sentry.io/)
Steps to Reproduce
npx @sentry/wizard@latest -i nextjs
All options for enhancements were marked as off.
Expected Result
That I can build the NextJS application. This is happening in a VPS from Hetzner with 4 vCPUs and 8gb ram.
Actual Result
Product Area
Unknown
Link
No response
DSN
No response
Version
No response
The text was updated successfully, but these errors were encountered: