From b40f3fdb7e532dfcbb1434fe991cc1ebac3cfb99 Mon Sep 17 00:00:00 2001 From: Luca Forstner Date: Tue, 28 Jan 2025 15:23:09 +0000 Subject: [PATCH 1/2] . --- .../e2e-tests/test-applications/nextjs-app-dir/assert-build.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/dev-packages/e2e-tests/test-applications/nextjs-app-dir/assert-build.ts b/dev-packages/e2e-tests/test-applications/nextjs-app-dir/assert-build.ts index 955988101724..77eedb8b392e 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-app-dir/assert-build.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-app-dir/assert-build.ts @@ -10,6 +10,7 @@ const buildStderr = fs.readFileSync('.tmp_build_stderr', 'utf-8'); // Assert that there was no funky build time warning when we are on a stable (pinned) version if (nextjsVersion !== 'latest' && !nextjsVersion.includes('-canary') && !nextjsVersion.includes('-rc')) { + console.log(buildStderr); assert.doesNotMatch(buildStderr, /Import trace for requested module/); // This is Next.js/Webpack speech for "something is off" } From ef233de04692603e1021da91868e19f54939a25f Mon Sep 17 00:00:00 2001 From: Luca Forstner Date: Tue, 28 Jan 2025 15:33:32 +0000 Subject: [PATCH 2/2] fix --- .../e2e-tests/test-applications/nextjs-app-dir/assert-build.ts | 3 +-- packages/nextjs/src/config/webpack.ts | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dev-packages/e2e-tests/test-applications/nextjs-app-dir/assert-build.ts b/dev-packages/e2e-tests/test-applications/nextjs-app-dir/assert-build.ts index 77eedb8b392e..70564e0c12bb 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-app-dir/assert-build.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-app-dir/assert-build.ts @@ -10,8 +10,7 @@ const buildStderr = fs.readFileSync('.tmp_build_stderr', 'utf-8'); // Assert that there was no funky build time warning when we are on a stable (pinned) version if (nextjsVersion !== 'latest' && !nextjsVersion.includes('-canary') && !nextjsVersion.includes('-rc')) { - console.log(buildStderr); - assert.doesNotMatch(buildStderr, /Import trace for requested module/); // This is Next.js/Webpack speech for "something is off" + assert.doesNotMatch(buildStderr, /Import trace for requested module/, `Build warning in output:\n${buildStderr}`); // This is Next.js/Webpack speech for "something is off" } // Assert that all static components stay static and all dynamic components stay dynamic diff --git a/packages/nextjs/src/config/webpack.ts b/packages/nextjs/src/config/webpack.ts index 8dbebf3935df..f82bb4a0476e 100644 --- a/packages/nextjs/src/config/webpack.ts +++ b/packages/nextjs/src/config/webpack.ts @@ -728,6 +728,7 @@ function addOtelWarningIgnoreRule(newConfig: WebpackConfigObjectWithModuleRules) // We provide these objects in addition to the hook above to provide redundancy in case the hook fails. { module: /@opentelemetry\/instrumentation/, message: /Critical dependency/ }, { module: /@prisma\/instrumentation/, message: /Critical dependency/ }, + { module: /require-in-the-middle/, message: /Critical dependency/ }, ] satisfies IgnoreWarningsOption; if (newConfig.ignoreWarnings === undefined) {