From b0242397ed957101a560456edf81b56940563911 Mon Sep 17 00:00:00 2001 From: s1gr1d Date: Thu, 5 Dec 2024 13:00:30 +0100 Subject: [PATCH] change warning log and add vercel --- packages/nuxt/src/module.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/nuxt/src/module.ts b/packages/nuxt/src/module.ts index 807abd8531bc..3eb9c9d78fe6 100644 --- a/packages/nuxt/src/module.ts +++ b/packages/nuxt/src/module.ts @@ -87,10 +87,19 @@ export default defineNuxtModule({ consoleSandbox(() => { const serverDir = nitro.options.output.serverDir; - if (serverDir.includes('.netlify')) { + // Netlify env: https://docs.netlify.com/configure-builds/environment-variables/#build-metadata + if (serverDir.includes('.netlify') || !!process.env.NETLIFY) { // eslint-disable-next-line no-console console.warn( - '[Sentry] Warning: The Sentry SDK discovered a Netlify build. The server-side Sentry support with ESM is experimental and may not work as expected. Please check out the docs for how to use Sentry on different deployment providers: https://docs.sentry.io/platforms/javascript/guides/nuxt/deployment-provider-setup/', + '[Sentry] Warning: The Sentry SDK detected a Netlify build. Server-side support for the Sentry Nuxt SDK on Netlify is currently unreliable due to technical limitations of serverless functions. Traces are not collected, and some errors may not be reported. For more information on setting up Sentry on the Nuxt server-side, please refer to the documentation: https://docs.sentry.io/platforms/javascript/guides/nuxt/install/', + ); + } + + // Vercel env: https://vercel.com/docs/projects/environment-variables/system-environment-variables#VERCEL + if (serverDir.includes('.vercel') || !!process.env.VERCEL) { + // eslint-disable-next-line no-console + console.warn( + '[Sentry] Warning: The Sentry SDK detected a Vercel build. The Sentry Nuxt SDK support for ESM on Vercel is currently experimental. Traces are not collected, but errors are reported. For more information on setting up Sentry on the Nuxt server-side, please refer to the documentation: https://docs.sentry.io/platforms/javascript/guides/nuxt/install/', ); } });