Skip to content

Commit

Permalink
feat(nuxt): Log server instrumentation might not work in dev (#14021)
Browse files Browse the repository at this point in the history
Sentry is initialized too late in development mode and tracing does not
work. This is a note to inform users about that. Will be fixed in the
stable version.
  • Loading branch information
s1gr1d authored Oct 18, 2024
1 parent 54d286b commit ab28544
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/nuxt/src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,15 @@ export default defineNuxtModule<ModuleOptions>({

nuxt.hooks.hook('nitro:init', nitro => {
if (serverConfigFile && serverConfigFile.includes('.server.config')) {
if (nitro.options.dev) {
consoleSandbox(() => {
// eslint-disable-next-line no-console
console.log(
'[Sentry] Your application is running in development mode. Note: @sentry/nuxt is in beta and may not work as expected on the server-side (Nitro). Errors are reported, but tracing does not work.',
);
});
}

if (moduleOptions.dynamicImportForServerEntry === false) {
addServerConfigToBuild(moduleOptions, nuxt, nitro, serverConfigFile);

Expand Down

0 comments on commit ab28544

Please sign in to comment.