mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
#94306 fixes this for pages, but middleware was still broken when deployed via adapters Coming from https://github.com/getsentry/sentry-javascript/issues/21713 Now the instrumentation test suite takes 11m to run in deployment mode though....
13 lines
449 B
JavaScript
13 lines
449 B
JavaScript
export async function register() {
|
|
await new Promise((resolve) => setTimeout(resolve, 1000))
|
|
if (process.env.NEXT_RUNTIME === 'edge') {
|
|
globalThis.instrumentationFinished = 'edge'
|
|
console.log('instrumentation hook on the edge')
|
|
} else if (process.env.NEXT_RUNTIME === 'nodejs') {
|
|
globalThis.instrumentationFinished = 'nodejs'
|
|
console.log('instrumentation hook on nodejs')
|
|
} else {
|
|
await require('this should fail')
|
|
}
|
|
}
|