Control NODE_OPTIONS on deploy #3982
Replies: 1 comment 3 replies
-
Ok, I think I was approaching this from the wrong angle. It appears this solves my needs https://nextjs.org/docs/pages/building-your-application/optimizing/instrumentation |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Question
Hello, I work at New Relic on the Node.js agent team and we have instrumentation for server-side Next.js. We have customers wanting to deploy their Next.js app on Vercel. To load our instrumentation you have to provide
NODE_OPTIONS='-r @newrelic/next'
at runtime. It does not appear that you can customize the run/deploy command. I tried just settingNODE_OPTIONS='-r @newrelic/next'
in the env vars but that runs at every phase and since the customer has yet to install deps that fails in build. I then tried to call a local js file and get clever and inspect the process.argv to decide if you should load the@newrelic/next
package but it says it cannot find the script.We just need advice here on how to control either the run/deploy command or how to inject NODE_OPTIONS only on run/deploy.
Beta Was this translation helpful? Give feedback.
All reactions