Skip to content

Commit c65597f

Browse files
authored
ref(nextjs): Remove instrumentSever (#6592)
1 parent afb3700 commit c65597f

File tree

4 files changed

+2
-397
lines changed

4 files changed

+2
-397
lines changed

packages/nextjs/package.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,5 @@
7777
},
7878
"volta": {
7979
"extends": "../../package.json"
80-
},
81-
"sideEffects": [
82-
"./cjs/index.server.js",
83-
"./esm/index.server.js",
84-
"./src/index.server.ts"
85-
]
80+
}
8681
}

packages/nextjs/rollup.npm.config.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,7 @@ export default [
55
makeBaseNPMConfig({
66
// We need to include `instrumentServer.ts` separately because it's only conditionally required, and so rollup
77
// doesn't automatically include it when calculating the module dependency tree.
8-
entrypoints: [
9-
'src/index.server.ts',
10-
'src/index.client.ts',
11-
'src/utils/instrumentServer.ts',
12-
'src/config/webpack.ts',
13-
],
8+
entrypoints: ['src/index.server.ts', 'src/index.client.ts', 'src/config/webpack.ts'],
149

1510
// prevent this internal nextjs code from ending up in our built package (this doesn't happen automatially because
1611
// the name doesn't match an SDK dependency)

packages/nextjs/src/index.server.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -175,19 +175,3 @@ export {
175175
withSentryAPI,
176176
withSentry,
177177
} from './config/wrappers';
178-
179-
// Wrap various server methods to enable error monitoring and tracing. (Note: This only happens for non-Vercel
180-
// deployments, because the current method of doing the wrapping a) crashes Next 12 apps deployed to Vercel and
181-
// b) doesn't work on those apps anyway. We also don't do it during build, because there's no server running in that
182-
// phase.)
183-
if (!IS_BUILD && !IS_VERCEL) {
184-
// Dynamically require the file because even importing from it causes Next 12 to crash on Vercel.
185-
// In environments where the JS file doesn't exist, such as testing, import the TS file.
186-
try {
187-
// eslint-disable-next-line @typescript-eslint/no-var-requires
188-
const { instrumentServer } = require('./utils/instrumentServer.js');
189-
instrumentServer();
190-
} catch (err) {
191-
__DEBUG_BUILD__ && logger.warn(`Error: Unable to instrument server for tracing. Got ${err}.`);
192-
}
193-
}

0 commit comments

Comments
 (0)