Skip to content

Commit

Permalink
drop the experimental env var
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi committed Jul 17, 2024
1 parent af3b329 commit 2013224
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 22 deletions.
5 changes: 1 addition & 4 deletions packages/next/src/server/base-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -836,10 +836,7 @@ export default abstract class Server<
) {
const [err, req, ctx] = args

if (
process.env.__NEXT_EXPERIMENTAL_INSTRUMENTATION &&
this.instrumentation
) {
if (this.instrumentation) {
try {
await this.instrumentation.onRequestError?.(
err,
Expand Down
7 changes: 1 addition & 6 deletions packages/next/src/server/web/globals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,7 @@ export async function edgeInstrumentationOnRequestError(
) {
const instrumentation = await getEdgeInstrumentationModule()
try {
if (
process.env.__NEXT_EXPERIMENTAL_INSTRUMENTATION &&
instrumentation?.onRequestError
) {
await instrumentation.onRequestError(...args)
}
await instrumentation?.onRequestError?.(...args)
} catch (err) {
// Log the soft error and continue, since the original error has already been thrown
console.error('Error in instrumentation.onRequestError:', err)
Expand Down
3 changes: 0 additions & 3 deletions test/e2e/on-request-error/basic/basic.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ describe('on-request-error - basic', () => {
const { next, skipped } = nextTestSetup({
files: __dirname,
skipDeployment: true,
env: {
__NEXT_EXPERIMENTAL_INSTRUMENTATION: '1',
},
})

if (skipped) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ describe('on-request-error - dynamic-routes', () => {
const { next, skipped } = nextTestSetup({
files: __dirname,
skipDeployment: true,
env: {
__NEXT_EXPERIMENTAL_INSTRUMENTATION: '1',
},
})

if (skipped) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ describe('on-request-error - server-action-error', () => {
const { next, skipped } = nextTestSetup({
files: __dirname,
skipDeployment: true,
env: {
__NEXT_EXPERIMENTAL_INSTRUMENTATION: '1',
},
})

if (skipped) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ describe('on-request-error - skip-next-internal-error', () => {
const { next, skipped } = nextTestSetup({
files: __dirname,
skipDeployment: true,
env: {
__NEXT_EXPERIMENTAL_INSTRUMENTATION: '1',
},
})

if (skipped) {
Expand Down

0 comments on commit 2013224

Please sign in to comment.