Skip to content

Commit

Permalink
change warning log and add vercel
Browse files Browse the repository at this point in the history
  • Loading branch information
s1gr1d committed Dec 5, 2024
1 parent be241f1 commit b024239
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions packages/nuxt/src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,19 @@ export default defineNuxtModule<ModuleOptions>({
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/',
);
}
});
Expand Down

0 comments on commit b024239

Please sign in to comment.