Skip to content

Commit 76b5c33

Browse files
authored
test: Fix nextjs build warning (#15207)
1 parent 3a1006e commit 76b5c33

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

dev-packages/e2e-tests/test-applications/nextjs-app-dir/assert-build.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const buildStderr = fs.readFileSync('.tmp_build_stderr', 'utf-8');
1010

1111
// Assert that there was no funky build time warning when we are on a stable (pinned) version
1212
if (nextjsVersion !== 'latest' && !nextjsVersion.includes('-canary') && !nextjsVersion.includes('-rc')) {
13-
assert.doesNotMatch(buildStderr, /Import trace for requested module/); // This is Next.js/Webpack speech for "something is off"
13+
assert.doesNotMatch(buildStderr, /Import trace for requested module/, `Build warning in output:\n${buildStderr}`); // This is Next.js/Webpack speech for "something is off"
1414
}
1515

1616
// Assert that all static components stay static and all dynamic components stay dynamic

packages/nextjs/src/config/webpack.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -728,6 +728,7 @@ function addOtelWarningIgnoreRule(newConfig: WebpackConfigObjectWithModuleRules)
728728
// We provide these objects in addition to the hook above to provide redundancy in case the hook fails.
729729
{ module: /@opentelemetry\/instrumentation/, message: /Critical dependency/ },
730730
{ module: /@prisma\/instrumentation/, message: /Critical dependency/ },
731+
{ module: /require-in-the-middle/, message: /Critical dependency/ },
731732
] satisfies IgnoreWarningsOption;
732733

733734
if (newConfig.ignoreWarnings === undefined) {

0 commit comments

Comments
 (0)