Skip to content

Commit b024239

Browse files
committed
change warning log and add vercel
1 parent be241f1 commit b024239

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
@@ -87,10 +87,19 @@ export default defineNuxtModule<ModuleOptions>({
8787
consoleSandbox(() => {
8888
const serverDir = nitro.options.output.serverDir;
8989

90-
if (serverDir.includes('.netlify')) {
90+
// Netlify env: https://docs.netlify.com/configure-builds/environment-variables/#build-metadata
91+
if (serverDir.includes('.netlify') || !!process.env.NETLIFY) {
9192
// eslint-disable-next-line no-console
9293
console.warn(
93-
'[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/',
94+
'[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/',
95+
);
96+
}
97+
98+
// Vercel env: https://vercel.com/docs/projects/environment-variables/system-environment-variables#VERCEL
99+
if (serverDir.includes('.vercel') || !!process.env.VERCEL) {
100+
// eslint-disable-next-line no-console
101+
console.warn(
102+
'[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/',
94103
);
95104
}
96105
});

0 commit comments

Comments
 (0)