Skip to content

Commit 318b750

Browse files
author
Luca Forstner
authored
ref(nextjs): Completely deprecate isBuild() and IS_BUILD (#6727)
1 parent 277264e commit 318b750

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

packages/nextjs/src/server/index.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,12 @@ const globalWithInjectedValues = global as typeof global & {
2424

2525
const domain = domainModule as typeof domainModule & { active: (domainModule.Domain & Carrier) | null };
2626

27-
// Exporting this constant means we can compute it without the linter complaining, even if we stop directly using it in
28-
// this file. It's important that it be computed as early as possible, because one of its indicators is seeing 'build'
29-
// (as in the CLI command `next build`) in `process.argv`. Later on in the build process, everything's been spun out
30-
// into child threads and `argv` turns into ['node', 'path/to/childProcess.js'], so the original indicator is lost. We
31-
// thus want to compute it as soon as the SDK is loaded for the first time, which is normally when the user imports
32-
// `withSentryConfig` into `next.config.js`.
27+
// TODO (v8): Remove this
28+
/**
29+
* @deprecated This constant will be removed in the next major update.
30+
*/
3331
export const IS_BUILD = isBuild();
32+
3433
const IS_VERCEL = !!process.env.VERCEL;
3534

3635
/** Inits the Sentry NextJS SDK on node. */
@@ -140,7 +139,7 @@ function addServerIntegrations(options: NodeOptions): void {
140139

141140
// TODO (v8): Remove this
142141
/**
143-
* @deprecated Use the constant `IS_BUILD` instead.
142+
* @deprecated This constant will be removed in the next major update.
144143
*/
145144
const deprecatedIsBuild = (): boolean => isBuild();
146145
// eslint-disable-next-line deprecation/deprecation

0 commit comments

Comments
 (0)