Compare commits

...

1 Commits

View File

@@ -19,6 +19,11 @@ export const withPayload = (nextConfig = {}, options = {}) => {
const turbopackWarningText =
'Packages that should be external need to be installed in the project directory, so they can be resolved from the output files.\nTry to install it into the project directory by running'
const turbopackWarningWebpackConfigured_1 =
'Webpack is configured while Turbopack is not, which may cause problems.'
const turbopackWarningWebpackConfigured_2 =
'See instructions if you need to configure Turbopack:'
const consoleWarn = console.warn
console.warn = (...args) => {
// Force to disable serverExternalPackages warnings: https://github.com/vercel/next.js/issues/68805
@@ -29,6 +34,15 @@ export const withPayload = (nextConfig = {}, options = {}) => {
return
}
// Force to disable Webpack is configured while Turbopack is not, which may cause problems.
if (
typeof args[0] === 'string' &&
(args[0].includes(turbopackWarningWebpackConfigured_1) ||
args[0].includes(turbopackWarningWebpackConfigured_2))
) {
return
}
consoleWarn(...args)
}
}