Skip to content

Cannot deploy my NextJS app to SST with Sentry's config #20951

Closed as not planned

Description

@jcohenho

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.53.1

Framework Version

16.1.6

Link to Sentry event

No response

Reproduction Example/SDK Setup

I am experiencing this in my NextJS + SST setup:

If I try to deploy with withSentryConfig(nextConfig, {...}) enabled in next.config.js, I get the following error:


┌──────────────────────────────┐
│ OpenNext — Generating bundle │
└──────────────────────────────┘

Bundling middleware function...
Bundling static assets...
Bundling cache assets...
Building server function: default...
file:///private/var/folders/cz/2jxz3hfs1w7czmcp87d0l50c0000fn/T/open-next-tmpbgBnDF/next.config.mjs:11
  throw Error('Dynamic require of "' + x + '" is not supported');
        ^

Error: Dynamic require of "fs" is not supported

Steps to Reproduce

  1. Add this to my next.config.ts:
import { withSentryConfig } from '@sentry/nextjs'
import type { NextConfig } from 'next'

const nextConfig: NextConfig = {
  /* config options here */
}

export default withSentryConfig(nextConfig, {
  org: 'myorg',
  project: 'myproject',
  // Upload source maps for readable stack traces
  authToken: process.env.SENTRY_AUTH_TOKEN,
  // Route Sentry requests through your server (avoids ad-blockers)
  tunnelRoute: '/sentry-tunnel',
  silent: !process.env.CI,
})

  1. Deploy with SST via npx sst deploy

Expected Result

I expect the deploy to succeed

Actual Result

I am experiencing this in my NextJS + SST setup:

If I try to deploy with withSentryConfig(nextConfig, {...}) enabled in next.config.js, I get the following error:


┌──────────────────────────────┐
│ OpenNext — Generating bundle │
└──────────────────────────────┘

Bundling middleware function...
Bundling static assets...
Bundling cache assets...
Building server function: default...
file:///private/var/folders/cz/2jxz3hfs1w7czmcp87d0l50c0000fn/T/open-next-tmpbgBnDF/next.config.mjs:11
  throw Error('Dynamic require of "' + x + '" is not supported');
        ^

Error: Dynamic require of "fs" is not supported

Additional Context

No response

Priority

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

Activity

  1. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on May 17, 2026
  2. linear-code commented on May 17, 2026

    @linear-code
  3. andreiborza commented on May 18, 2026

    @andreiborza
    Member

    Hi @jcohenho, thanks for writing in.

    I was not able to reproduce this here. Could you please provide a minimal reproduction repo or try to break my example?

  4. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on May 18, 2026
  5. moved this to Waiting for: Community in GitHub Issues with 👀 3on May 18, 2026
  6. 4 remaining items

  7. moved this from Waiting for: Community to Waiting for: Product Owner in GitHub Issues with 👀 3on Jun 8, 2026
  8. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Jun 9, 2026
  9. moved this to Waiting for: Community in GitHub Issues with 👀 3on Jun 9, 2026
  10. getsantry commented on Jul 1, 2026

    @getsantry

    This issue has gone three weeks without activity. In another week, I will close it.

    But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!


    "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

  11. jcohenho commented on Jul 15, 2026

    @jcohenho
    Author

    We can close this as resolved, I fixed the issue by upgrading SST.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions