Skip to content

Sentry causes Next.js 16 build to fail when using standalone output #18001

@tiagoskaneta

Description

@tiagoskaneta

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.js 16

Link to Sentry event

No response

Reproduction Example/SDK Setup

No response

Steps to Reproduce

  1. Create a new nextjs 16 project - I believe the issue only occurs when using the Page router but cannot confirm
  2. Configure sentry using the wizard
  3. Add a proxy.ts to the project (the example code https://nextjs.org/docs/app/getting-started/proxy should suffice)
  4. Change the next.config.ts to
const nextConfig: NextConfig = {
  output: 'standalone',
};
  1. npm run build

Expected Result

Build should succeed

Actual Result

> Build error occurred
Error: ENOENT: no such file or directory, copyfile 'test-sentry/.next/server/proxy.js' -> 'test-sentry/.next/standalone/.next/server/proxy.js'
    at ignore-listed frames {
  errno: -2,
  code: 'ENOENT',
  syscall: 'copyfile',
  path: 'test-sentry/.next/server/proxy.js',
  dest: 'test-sentry/.next/standalone/.next/server/proxy.js'
}

Additional Context

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

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions