Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(nextjs): Disable server webpack-handling for static builds #15751

Merged
merged 2 commits into from
Mar 24, 2025

Conversation

s1gr1d
Copy link
Member

@s1gr1d s1gr1d commented Mar 20, 2025

When static builds are enabled, Sentry should not change webpack configuration for the server/edge runtime as there is no server.

closes #12420

@s1gr1d s1gr1d requested review from lforst and chargome March 20, 2025 11:16
// Symbolication for dev-mode errors is done elsewhere.
if (!isDev) {
if (!isDev || !(isStaticExport && isServer)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (!isDev || !(isStaticExport && isServer)) {
if (!isDev && !(isStaticExport && isServer)) {

Only handle webpack when we're in prod AND we don't have a output: 'export' build

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed it to !(isDev || (isStaticExport && isServer)) as it's easier to wrap the head around it (it contains two sides connected with OR and then everything is negated).

However, it's the same logical expression as !isDev && !(isStaticExport && isServer).

@s1gr1d s1gr1d merged commit 9cdd2d9 into develop Mar 24, 2025
152 checks passed
@s1gr1d s1gr1d deleted the sig/nextjs-static-no-source-map branch March 24, 2025 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy