if (newrelic && newrelic?.agent && !newrelic?.agent?.collector.isConnected()) {
await new Promise((resolve) => {
newrelic?.agent?.on?("connected", resolve);
});
}
In the event that NEW_RELIC_ENABLED is false or even just to generate a static next build or even just to run this locally in development mode with new relic not enabled because newrelic will crash the entire application.
https://github.com/newrelic-experimental/newrelic-nextjs-integration/blob/9a447df66b90dc7ad1e4e403b41aad8c00800cc5/pages/_document.tsx#L28-L32
This should be:
In the event that NEW_RELIC_ENABLED is false or even just to generate a static next build or even just to run this locally in development mode with new relic not enabled because newrelic will crash the entire application.