Skip to content

[turbopack] Update Turbopack build warning message #82591

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 13, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 7 additions & 26 deletions packages/next/src/build/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3980,7 +3980,7 @@ export default async function build(
await lockfilePatchPromise.cur

if (isTurbopack && !process.env.__NEXT_TEST_MODE) {
warnAboutTurbopackBuilds(loadedConfig)
warnAboutTurbopackBuilds()
}

// Ensure all traces are flushed before finishing the command
Expand All @@ -4007,31 +4007,12 @@ function errorFromUnsupportedSegmentConfig(): never {
process.exit(1)
}

function warnAboutTurbopackBuilds(config?: NextConfigComplete) {
let warningStr =
`Support for Turbopack builds is experimental. ` +
bold(
`We don't recommend deploying mission-critical applications to production.`
)
warningStr +=
'\n\n- ' +
bold(
'Turbopack currently always builds production source maps for the browser. This will include project source code if deployed to production.'
)
warningStr +=
'\n- It is expected that your bundle size might be different from `next build` with webpack. This will be improved as we work towards stability.'

if (!config?.experimental.turbopackPersistentCaching) {
warningStr +=
'\n- This build is without disk caching; subsequent builds will become faster when disk caching becomes available.'
}

warningStr +=
'\n- When comparing output to webpack builds, make sure to first clear the Next.js cache by deleting the `.next` directory.'
warningStr +=
'\n\nProvide feedback for Turbopack builds at https://github.com/vercel/next.js/discussions/77721'

Log.warn(warningStr)
function warnAboutTurbopackBuilds() {
Log.ready(
`Turbopack builds are ${bold('beta')}.\n\n` +
' Please see our docs https://nextjs.org/docs/app/api-reference/turbopack for information on known differences with webpack builds.\n\n' +
' Provide feedback for Turbopack builds at https://github.com/vercel/next.js/discussions/77721'
)
}

function getBundlerForTelemetry(isTurbopack: boolean) {
Expand Down
Loading