Skip to content

Commit

Permalink
test(v8): Fix nextjs build warning (#15226)
Browse files Browse the repository at this point in the history
This also needs to go into v8, I guess!

---------

Co-authored-by: Luca Forstner <[email protected]>
  • Loading branch information
mydea and lforst authored Jan 29, 2025
1 parent 0cfcd6f commit 4574acc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +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')) {
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
Expand Down
1 change: 1 addition & 0 deletions packages/nextjs/src/config/webpack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,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) {
Expand Down

0 comments on commit 4574acc

Please sign in to comment.