File tree Expand file tree Collapse file tree 2 files changed +12
-8
lines changed
Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -117,7 +117,7 @@ export default defineNuxtModule<ModuleOptions>({
117117 if ( serverConfigFile ) {
118118 addMiddlewareImports ( ) ;
119119 addStorageInstrumentation ( nuxt ) ;
120- addDatabaseInstrumentation ( nuxt . options . nitro ) ;
120+ addDatabaseInstrumentation ( nuxt . options . nitro , moduleOptions ) ;
121121 }
122122
123123 // Add the sentry config file to the include array
Original file line number Diff line number Diff line change 11import { addServerPlugin , createResolver } from '@nuxt/kit' ;
22import { consoleSandbox } from '@sentry/core' ;
33import type { NitroConfig } from 'nitropack/types' ;
4+ import type { SentryNuxtModuleOptions } from '../common/types' ;
45import { addServerTemplate } from '../vendor/server-template' ;
56
67/**
78 * Sets up the database instrumentation.
89 */
9- export function addDatabaseInstrumentation ( nitro : NitroConfig ) : void {
10+ export function addDatabaseInstrumentation ( nitro : NitroConfig , moduleOptions ?: SentryNuxtModuleOptions ) : void {
1011 if ( ! nitro . experimental ?. database ) {
11- consoleSandbox ( ( ) => {
12- // eslint-disable-next-line no-console
13- console . log (
14- '[Sentry] [Nitro Database Plugin]: No database configuration found. Skipping database instrumentation.' ,
15- ) ;
16- } ) ;
12+ // We cannot use DEBUG_BUILD here because it is a runtime flag, so it is not available for build time scripts
13+ // So we have to pass in the module options to the build time script
14+ moduleOptions ?. debug &&
15+ consoleSandbox ( ( ) => {
16+ // eslint-disable-next-line no-console
17+ console . log (
18+ '[Sentry] [Nitro Database Plugin]: No database configuration found. Skipping database instrumentation.' ,
19+ ) ;
20+ } ) ;
1721
1822 return ;
1923 }
You can’t perform that action at this time.
0 commit comments