Next.js Discord

Discord Forum

Instrumentation runs twice on built apps

Unanswered
Savannah posted this in #help-forum
Open in Discord
SavannahOP
So for some reason using the instrumentation it runs twice after doing yarn build then yarn start.
It only runs once for yarn dev though
instrumentation.js
export async function register() {
    if (process.env.NEXT_RUNTIME === 'nodejs') {
        console.log('Should only see once');
    }
}

yarn dev:
Should only see once
yarn start:
Should only see once
Should only see once

2 Replies