Skip to content

Commit 4786a83

Browse files
author
Luca Forstner
authored
feat(nextjs): Ignore Prisma critical dependency warnings (#12144)
1 parent 10fbee2 commit 4786a83

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

packages/nextjs/src/config/webpack.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -660,10 +660,14 @@ function getRequestAsyncStorageModuleLocation(
660660
}
661661

662662
function addOtelWarningIgnoreRule(newConfig: WebpackConfigObjectWithModuleRules): void {
663-
const ignoreRule = { module: /@opentelemetry\/instrumentation/ };
663+
const ignoreRules = [
664+
{ module: /@opentelemetry\/instrumentation/, message: /Critical dependency/ },
665+
{ module: /@prisma\/instrumentation/, message: /Critical dependency/ },
666+
];
667+
664668
if (newConfig.ignoreWarnings === undefined) {
665-
newConfig.ignoreWarnings = [ignoreRule];
669+
newConfig.ignoreWarnings = ignoreRules;
666670
} else if (Array.isArray(newConfig.ignoreWarnings)) {
667-
newConfig.ignoreWarnings.push(ignoreRule);
671+
newConfig.ignoreWarnings.push(...ignoreRules);
668672
}
669673
}

0 commit comments

Comments
 (0)