Instrumentation runs twice on built apps
Unanswered
Savannah posted this in #help-forum
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
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 once2 Replies
SavannahOP
For a maybe unintended work around i found this will work
if (process.env.NEXT_RUNTIME === 'nodejs' && typeof process.env.__NEXT_PRIVATE_PREBUNDLED_REACT === 'undefined') {