Skip to content

Slow build-times and Webpack serialization performance warnings when using @sentry/nextjs #15100

Open
@scobbe

Description

@scobbe

⚠️ Edit by @lforst: This issue is confirmed. Please see #15100 (comment) for more information on why builds are slow when adding the Sentry SDK, and for temporary workarounds until performance issues are fixed within the SDK.

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/nestjs

SDK Version

8.50.0

Framework Version

React 19.0.0, Next 15.1.4, Node 22.9.0

Link to Sentry event

No response

Reproduction Example/SDK Setup

Description

When adding Sentry configuration to next.config.ts using withSentryConfig, I encounter the following warning during the build process:

<w> [webpack.cache.PackFileCacheStrategy] Serializing big strings (318kiB) impacts deserialization performance (consider using Buffer instead and decode when needed)

Is this a known issue? Are there any recommendations for addressing this warning, such as additional configuration options or workarounds?

Thank you!

Steps to Reproduce

  1. Start with a minimal next.config.ts file:

    import type { NextConfig } from "next";
    
    const nextConfig: NextConfig = {};
    
    export default nextConfig;
  2. Update the file to include Sentry's configuration using withSentryConfig:

    import type { NextConfig } from "next";
    
    import { withSentryConfig } from "@sentry/nextjs";
    
    const nextConfig: NextConfig = {};
    
    export default withSentryConfig(nextConfig, {
      automaticVercelMonitors: true,
      disableLogger: true,
      hideSourceMaps: true,
      org: "MyOrg",
      project: "javascript-nextjs",
      reactComponentAnnotation: {
        enabled: true,
      },
      silent: !process.env.CI,
      sourcemaps: {
        deleteSourcemapsAfterUpload: true,
        disable: process.env.NODE_ENV === "development",
      },
      tunnelRoute: "/monitoring",
      widenClientFileUpload: true,
    });
  3. Run the build process.

Expected Result

The build completes without warnings or errors.

Actual Result

The following warning appears during the build process:

<w> [webpack.cache.PackFileCacheStrategy] Serializing big strings (318kiB) impacts deserialization performance (consider using Buffer instead and decode when needed)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions