diff --git a/packages/nextjs/src/config/webpack.ts b/packages/nextjs/src/config/webpack.ts index 5c06644f3b48..14cdad42a25e 100644 --- a/packages/nextjs/src/config/webpack.ts +++ b/packages/nextjs/src/config/webpack.ts @@ -660,10 +660,14 @@ function getRequestAsyncStorageModuleLocation( } function addOtelWarningIgnoreRule(newConfig: WebpackConfigObjectWithModuleRules): void { - const ignoreRule = { module: /@opentelemetry\/instrumentation/ }; + const ignoreRules = [ + { module: /@opentelemetry\/instrumentation/, message: /Critical dependency/ }, + { module: /@prisma\/instrumentation/, message: /Critical dependency/ }, + ]; + if (newConfig.ignoreWarnings === undefined) { - newConfig.ignoreWarnings = [ignoreRule]; + newConfig.ignoreWarnings = ignoreRules; } else if (Array.isArray(newConfig.ignoreWarnings)) { - newConfig.ignoreWarnings.push(ignoreRule); + newConfig.ignoreWarnings.push(...ignoreRules); } }