mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
Fixed issue where `require` will return a Promise if (and only if) there is an ESM module imported in `instrumentation.ts`: https://github.com/vercel/next.js/blob/61cd219f1597e9c25e4eb812365f967e0caa2df2/packages/next/src/server/next-server.ts#L212 Had to move stuff to async function from constructor, but luckily we already have `prepare`.
8 lines
216 B
JavaScript
8 lines
216 B
JavaScript
import * as otel from '@vercel/otel'
|
|
|
|
export function register() {
|
|
console.log('register in instrumentation.js is running')
|
|
// make sure that this is not tree-shaken
|
|
if (process.env.DOESNT_EXIST_1234) otel()
|
|
}
|