Repository navigation
Cannot deploy my NextJS app to SST with Sentry's config #20951
Copy link
Copy link
Closed as not planned
Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
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
- 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,
})
- 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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Projects
- StatusShow more project fieldsWaiting for: Community
Activity
linear-code commentedon May 17, 2026
JS-2520
andreiborza commentedon May 18, 2026
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 remaining items
getsantry commentedon Jul 1, 2026
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 🥀
jcohenho commentedon Jul 15, 2026
We can close this as resolved, I fixed the issue by upgrading SST.