Skip to content

Commit c5f57b2

Browse files
committed
change warning log and add vercel
1 parent a508319 commit c5f57b2

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

packages/nuxt/src/module.ts

+11-2
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,19 @@ export default defineNuxtModule<ModuleOptions>({
9191
consoleSandbox(() => {
9292
const serverDir = nitro.options.output.serverDir;
9393

94-
if (serverDir.includes('.netlify')) {
94+
// Netlify env: https://docs.netlify.com/configure-builds/environment-variables/#build-metadata
95+
if (serverDir.includes('.netlify') || !!process.env.NETLIFY) {
9596
// eslint-disable-next-line no-console
9697
console.warn(
97-
'[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/',
98+
'[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/',
99+
);
100+
}
101+
102+
// Vercel env: https://vercel.com/docs/projects/environment-variables/system-environment-variables#VERCEL
103+
if (serverDir.includes('.vercel') || !!process.env.VERCEL) {
104+
// eslint-disable-next-line no-console
105+
console.warn(
106+
'[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/',
98107
);
99108
}
100109
});

0 commit comments

Comments
 (0)