Skip to content

Commit ab28544

Browse files
authored
feat(nuxt): Log server instrumentation might not work in dev (#14021)
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.
1 parent 54d286b commit ab28544

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

packages/nuxt/src/module.ts

+9
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,15 @@ export default defineNuxtModule<ModuleOptions>({
7474

7575
nuxt.hooks.hook('nitro:init', nitro => {
7676
if (serverConfigFile && serverConfigFile.includes('.server.config')) {
77+
if (nitro.options.dev) {
78+
consoleSandbox(() => {
79+
// eslint-disable-next-line no-console
80+
console.log(
81+
'[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.',
82+
);
83+
});
84+
}
85+
7786
if (moduleOptions.dynamicImportForServerEntry === false) {
7887
addServerConfigToBuild(moduleOptions, nuxt, nitro, serverConfigFile);
7988

0 commit comments

Comments
 (0)