Skip to content

Sentry causes Next.js standalone to copy entire repo into build output #18004

@BTOdell

Description

@BTOdell

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/nextjs

SDK Version

10.21.0

Framework Version

Next 16.0.0

Link to Sentry event

No response

Reproduction Example/SDK Setup

https://github.com/BTOdell/sentry-nextjs-standalone-bug

Steps to Reproduce

  1. Set Next.js build output to 'standalone'
  2. Import Sentry SDK from instrumentation.ts (don't even need to configure Sentry in next.config.ts)

Expected Result

Next.js standalone build output should only contain the minimal files needed to run the app

Actual Result

Standalone output directory contains copy of the entire repository / project

Additional Context

Confirmed that this bug does not happen with Next 15.4.4 with @sentry/nextjs v9 nor v10.
Likely a compatibility issue with Next 16?

May be related to #18001, but I'm not getting a build error - just incorrect build output.

Tip: React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it.

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions