Unverified Commit 4c128a5d authored by Tim Neutkens's avatar Tim Neutkens Committed by GitHub

Ensure configuration is checked for Turbopack build (#64247)

## What?

Currently any configuration issue like including `.babelrc` was not
highlighted during Turbopack build. This PR solves that issue as well as
ensuring the warnings are not double-logged because of a change that was
supposed to be development-only.

<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->


Closes NEXT-3049
parent e1e3332b
...@@ -45,6 +45,7 @@ import type { ...@@ -45,6 +45,7 @@ import type {
import { nonNullable } from '../lib/non-nullable' import { nonNullable } from '../lib/non-nullable'
import { recursiveDelete } from '../lib/recursive-delete' import { recursiveDelete } from '../lib/recursive-delete'
import { verifyPartytownSetup } from '../lib/verify-partytown-setup' import { verifyPartytownSetup } from '../lib/verify-partytown-setup'
import { validateTurboNextConfig } from '../lib/turbopack-warning'
import { import {
BUILD_ID_FILE, BUILD_ID_FILE,
BUILD_MANIFEST, BUILD_MANIFEST,
...@@ -176,7 +177,7 @@ import { ...@@ -176,7 +177,7 @@ import {
handleRouteType, handleRouteType,
handlePagesErrorRoute, handlePagesErrorRoute,
formatIssue, formatIssue,
printNonFatalIssue, isRelevantWarning,
} from '../server/dev/turbopack-utils' } from '../server/dev/turbopack-utils'
import { TurbopackManifestLoader } from '../server/dev/turbopack/manifest-loader' import { TurbopackManifestLoader } from '../server/dev/turbopack/manifest-loader'
import type { Entrypoints } from '../server/dev/turbopack/types' import type { Entrypoints } from '../server/dev/turbopack/types'
...@@ -1346,6 +1347,11 @@ export default async function build( ...@@ -1346,6 +1347,11 @@ export default async function build(
throw new Error("next build doesn't support turbopack yet") throw new Error("next build doesn't support turbopack yet")
} }
await validateTurboNextConfig({
dir,
isDev: false,
})
const startTime = process.hrtime() const startTime = process.hrtime()
const bindings = await loadBindings(config?.experimental?.useWasmBinary) const bindings = await loadBindings(config?.experimental?.useWasmBinary)
const dev = false const dev = false
...@@ -1448,6 +1454,7 @@ export default async function build( ...@@ -1448,6 +1454,7 @@ export default async function build(
manifestLoader, manifestLoader,
nextConfig: config, nextConfig: config,
rewrites: emptyRewritesObjToBeImplemented, rewrites: emptyRewritesObjToBeImplemented,
logErrors: false,
}) })
const progress = createProgress( const progress = createProgress(
...@@ -1482,6 +1489,7 @@ export default async function build( ...@@ -1482,6 +1489,7 @@ export default async function build(
entrypoints: currentEntrypoints, entrypoints: currentEntrypoints,
manifestLoader, manifestLoader,
rewrites: emptyRewritesObjToBeImplemented, rewrites: emptyRewritesObjToBeImplemented,
logErrors: false,
}) })
) )
} }
...@@ -1497,6 +1505,7 @@ export default async function build( ...@@ -1497,6 +1505,7 @@ export default async function build(
entrypoints: currentEntrypoints, entrypoints: currentEntrypoints,
manifestLoader, manifestLoader,
rewrites: emptyRewritesObjToBeImplemented, rewrites: emptyRewritesObjToBeImplemented,
logErrors: false,
}) })
) )
} }
...@@ -1507,6 +1516,7 @@ export default async function build( ...@@ -1507,6 +1516,7 @@ export default async function build(
entrypoints: currentEntrypoints, entrypoints: currentEntrypoints,
manifestLoader, manifestLoader,
rewrites: emptyRewritesObjToBeImplemented, rewrites: emptyRewritesObjToBeImplemented,
logErrors: false,
}) })
) )
await Promise.all(promises) await Promise.all(promises)
...@@ -1520,6 +1530,10 @@ export default async function build( ...@@ -1520,6 +1530,10 @@ export default async function build(
page: string page: string
message: string message: string
}[] = [] }[] = []
const warnings: {
page: string
message: string
}[] = []
for (const [page, entryIssues] of currentEntryIssues) { for (const [page, entryIssues] of currentEntryIssues) {
for (const issue of entryIssues.values()) { for (const issue of entryIssues.values()) {
if (issue.severity !== 'warning') { if (issue.severity !== 'warning') {
...@@ -1528,14 +1542,29 @@ export default async function build( ...@@ -1528,14 +1542,29 @@ export default async function build(
message: formatIssue(issue), message: formatIssue(issue),
}) })
} else { } else {
printNonFatalIssue(issue) if (isRelevantWarning(issue)) {
warnings.push({
page,
message: formatIssue(issue),
})
}
} }
} }
} }
if (warnings.length > 0) {
Log.warn(
`Turbopack build collected ${warnings.length} warnings:\n${warnings
.map((e) => {
return 'Page: ' + e.page + '\n' + e.message
})
.join('\n')}`
)
}
if (errors.length > 0) { if (errors.length > 0) {
throw new Error( throw new Error(
`Turbopack build failed with ${errors.length} issues:\n${errors `Turbopack build failed with ${errors.length} errors:\n${errors
.map((e) => { .map((e) => {
return 'Page: ' + e.page + '\n' + e.message return 'Page: ' + e.page + '\n' + e.message
}) })
......
...@@ -2,7 +2,10 @@ import type { NextConfig } from '../server/config-shared' ...@@ -2,7 +2,10 @@ import type { NextConfig } from '../server/config-shared'
import path from 'path' import path from 'path'
import loadConfig from '../server/config' import loadConfig from '../server/config'
import * as Log from '../build/output/log' import * as Log from '../build/output/log'
import { PHASE_DEVELOPMENT_SERVER } from '../shared/lib/constants' import {
PHASE_DEVELOPMENT_SERVER,
PHASE_PRODUCTION_BUILD,
} from '../shared/lib/constants'
const unsupportedTurbopackNextConfigOptions = [ const unsupportedTurbopackNextConfigOptions = [
// is this supported? // is this supported?
...@@ -48,21 +51,13 @@ const unsupportedTurbopackNextConfigOptions = [ ...@@ -48,21 +51,13 @@ const unsupportedTurbopackNextConfigOptions = [
] ]
// The following will need to be supported by `next build --turbo` // The following will need to be supported by `next build --turbo`
const prodSpecificTurboNextConfigOptions = [ const unsupportedProductionSpecificTurbopackNextConfigOptions = [
'eslint',
'typescript',
'outputFileTracing', 'outputFileTracing',
'generateBuildId', // TODO: Support disabling sourcemaps, currently they're always enabled.
'compress', // 'productionBrowserSourceMaps',
'productionBrowserSourceMaps',
'optimizeFonts',
'poweredByHeader',
'staticPageGenerationTimeout',
'reactProductionProfiling', 'reactProductionProfiling',
'cleanDistDir',
'experimental.turbotrace', 'experimental.turbotrace',
'experimental.outputFileTracingRoot', 'experimental.outputFileTracingRoot',
'experimental.outputFileTracingExcludes',
'experimental.outputFileTracingIgnores', 'experimental.outputFileTracingIgnores',
'experimental.outputFileTracingIncludes', 'experimental.outputFileTracingIncludes',
] ]
...@@ -72,10 +67,7 @@ export async function validateTurboNextConfig({ ...@@ -72,10 +67,7 @@ export async function validateTurboNextConfig({
dir, dir,
isDev, isDev,
}: { }: {
allowRetry?: boolean
dir: string dir: string
port: number
hostname?: string
isDev?: boolean isDev?: boolean
}) { }) {
const { getPkgManager } = const { getPkgManager } =
...@@ -99,15 +91,16 @@ export async function validateTurboNextConfig({ ...@@ -99,15 +91,16 @@ export async function validateTurboNextConfig({
let unsupportedConfig: string[] = [] let unsupportedConfig: string[] = []
let rawNextConfig: NextConfig = {} let rawNextConfig: NextConfig = {}
const phase = isDev ? PHASE_DEVELOPMENT_SERVER : PHASE_PRODUCTION_BUILD
try { try {
rawNextConfig = interopDefault( rawNextConfig = interopDefault(
await loadConfig(PHASE_DEVELOPMENT_SERVER, dir, { await loadConfig(phase, dir, {
rawConfig: true, rawConfig: true,
}) })
) as NextConfig ) as NextConfig
if (typeof rawNextConfig === 'function') { if (typeof rawNextConfig === 'function') {
rawNextConfig = (rawNextConfig as any)(PHASE_DEVELOPMENT_SERVER, { rawNextConfig = (rawNextConfig as any)(phase, {
defaultConfig, defaultConfig,
}) })
} }
...@@ -150,7 +143,10 @@ export async function validateTurboNextConfig({ ...@@ -150,7 +143,10 @@ export async function validateTurboNextConfig({
let unsupportedKeys = isDev let unsupportedKeys = isDev
? unsupportedTurbopackNextConfigOptions ? unsupportedTurbopackNextConfigOptions
: prodSpecificTurboNextConfigOptions : [
...unsupportedTurbopackNextConfigOptions,
...unsupportedProductionSpecificTurbopackNextConfigOptions,
]
for (const key of customKeys) { for (const key of customKeys) {
if (key.startsWith('webpack') && rawNextConfig.webpack) { if (key.startsWith('webpack') && rawNextConfig.webpack) {
......
...@@ -363,7 +363,7 @@ export async function createHotReloaderTurbopack( ...@@ -363,7 +363,7 @@ export async function createHotReloaderTurbopack(
const changed = await changedPromise const changed = await changedPromise
for await (const change of changed) { for await (const change of changed) {
processIssues(currentEntryIssues, key, change) processIssues(currentEntryIssues, key, change, false, true)
const payload = await makePayload(change) const payload = await makePayload(change)
if (payload) { if (payload) {
sendHmr(key, payload) sendHmr(key, payload)
...@@ -401,7 +401,7 @@ export async function createHotReloaderTurbopack( ...@@ -401,7 +401,7 @@ export async function createHotReloaderTurbopack(
await subscription.next() await subscription.next()
for await (const data of subscription) { for await (const data of subscription) {
processIssues(state.clientIssues, key, data) processIssues(state.clientIssues, key, data, false, true)
if (data.type !== 'issues') { if (data.type !== 'issues') {
sendTurbopackMessage(data) sendTurbopackMessage(data)
} }
...@@ -453,6 +453,7 @@ export async function createHotReloaderTurbopack( ...@@ -453,6 +453,7 @@ export async function createHotReloaderTurbopack(
manifestLoader, manifestLoader,
nextConfig: opts.nextConfig, nextConfig: opts.nextConfig,
rewrites: opts.fsChecker.rewrites, rewrites: opts.fsChecker.rewrites,
logErrors: true,
dev: { dev: {
assetMapper, assetMapper,
...@@ -778,6 +779,7 @@ export async function createHotReloaderTurbopack( ...@@ -778,6 +779,7 @@ export async function createHotReloaderTurbopack(
entrypoints: currentEntrypoints, entrypoints: currentEntrypoints,
manifestLoader, manifestLoader,
rewrites: opts.fsChecker.rewrites, rewrites: opts.fsChecker.rewrites,
logErrors: true,
hooks: { hooks: {
subscribeToChanges, subscribeToChanges,
...@@ -830,6 +832,7 @@ export async function createHotReloaderTurbopack( ...@@ -830,6 +832,7 @@ export async function createHotReloaderTurbopack(
manifestLoader, manifestLoader,
readyIds, readyIds,
rewrites: opts.fsChecker.rewrites, rewrites: opts.fsChecker.rewrites,
logErrors: true,
hooks: { hooks: {
subscribeToChanges, subscribeToChanges,
......
...@@ -64,15 +64,22 @@ export function isWellKnownError(issue: Issue): boolean { ...@@ -64,15 +64,22 @@ export function isWellKnownError(issue: Issue): boolean {
/// Print out an issue to the console which should not block /// Print out an issue to the console which should not block
/// the build by throwing out or blocking error overlay. /// the build by throwing out or blocking error overlay.
export function printNonFatalIssue(issue: Issue) { export function printNonFatalIssue(issue: Issue) {
// Currently only warnings will be printed, excluding if the error source if (isRelevantWarning(issue)) {
// is coming from foreign (node_modules) codes. Log.warn(formatIssue(issue))
if (issue.severity === 'warning') {
if (!issue.filePath.match(/^(?:.*[\\/])?node_modules(?:[\\/].*)?$/)) {
Log.warn(formatIssue(issue))
}
} }
} }
function isNodeModulesIssue(issue: Issue): boolean {
return (
issue.severity === 'warning' &&
issue.filePath.match(/^(?:.*[\\/])?node_modules(?:[\\/].*)?$/) !== null
)
}
export function isRelevantWarning(issue: Issue): boolean {
return issue.severity === 'warning' && !isNodeModulesIssue(issue)
}
export function formatIssue(issue: Issue) { export function formatIssue(issue: Issue) {
const { filePath, title, description, source } = issue const { filePath, title, description, source } = issue
let { documentationLink } = issue let { documentationLink } = issue
...@@ -94,7 +101,7 @@ export function formatIssue(issue: Issue) { ...@@ -94,7 +101,7 @@ export function formatIssue(issue: Issue) {
.replaceAll('/./', '/') .replaceAll('/./', '/')
.replace('\\\\?\\', '') .replace('\\\\?\\', '')
let message let message = ''
if (source && source.range) { if (source && source.range) {
const { start } = source.range const { start } = source.range
...@@ -174,7 +181,8 @@ export function processIssues( ...@@ -174,7 +181,8 @@ export function processIssues(
currentEntryIssues: EntryIssuesMap, currentEntryIssues: EntryIssuesMap,
key: EntryKey, key: EntryKey,
result: TurbopackResult, result: TurbopackResult,
throwIssue = false throwIssue: boolean,
logErrors: boolean
) { ) {
const newIssues = new Map<IssueKey, Issue>() const newIssues = new Map<IssueKey, Issue>()
currentEntryIssues.set(key, newIssues) currentEntryIssues.set(key, newIssues)
...@@ -195,7 +203,7 @@ export function processIssues( ...@@ -195,7 +203,7 @@ export function processIssues(
if (issue.severity !== 'warning') { if (issue.severity !== 'warning') {
relevantIssues.add(formatted) relevantIssues.add(formatted)
if (isWellKnownError(issue)) { if (logErrors && isWellKnownError(issue)) {
Log.error(formatted) Log.error(formatted)
} }
} }
...@@ -296,6 +304,7 @@ export async function handleRouteType({ ...@@ -296,6 +304,7 @@ export async function handleRouteType({
readyIds, readyIds,
rewrites, rewrites,
hooks, hooks,
logErrors,
}: { }: {
dev: boolean dev: boolean
page: string page: string
...@@ -306,6 +315,7 @@ export async function handleRouteType({ ...@@ -306,6 +315,7 @@ export async function handleRouteType({
entrypoints: Entrypoints entrypoints: Entrypoints
manifestLoader: TurbopackManifestLoader manifestLoader: TurbopackManifestLoader
rewrites: SetupOpts['fsChecker']['rewrites'] rewrites: SetupOpts['fsChecker']['rewrites']
logErrors: boolean
readyIds?: ReadyIds // dev readyIds?: ReadyIds // dev
...@@ -322,7 +332,13 @@ export async function handleRouteType({ ...@@ -322,7 +332,13 @@ export async function handleRouteType({
const writtenEndpoint = await entrypoints.global.app.writeToDisk() const writtenEndpoint = await entrypoints.global.app.writeToDisk()
hooks?.handleWrittenEndpoint(key, writtenEndpoint) hooks?.handleWrittenEndpoint(key, writtenEndpoint)
processIssues(currentEntryIssues, key, writtenEndpoint) processIssues(
currentEntryIssues,
key,
writtenEndpoint,
false,
logErrors
)
} }
await manifestLoader.loadBuildManifest('_app') await manifestLoader.loadBuildManifest('_app')
await manifestLoader.loadPagesManifest('_app') await manifestLoader.loadPagesManifest('_app')
...@@ -333,7 +349,13 @@ export async function handleRouteType({ ...@@ -333,7 +349,13 @@ export async function handleRouteType({
const writtenEndpoint = const writtenEndpoint =
await entrypoints.global.document.writeToDisk() await entrypoints.global.document.writeToDisk()
hooks?.handleWrittenEndpoint(key, writtenEndpoint) hooks?.handleWrittenEndpoint(key, writtenEndpoint)
processIssues(currentEntryIssues, key, writtenEndpoint) processIssues(
currentEntryIssues,
key,
writtenEndpoint,
false,
logErrors
)
} }
await manifestLoader.loadPagesManifest('_document') await manifestLoader.loadPagesManifest('_document')
...@@ -358,7 +380,13 @@ export async function handleRouteType({ ...@@ -358,7 +380,13 @@ export async function handleRouteType({
pageEntrypoints: entrypoints.page, pageEntrypoints: entrypoints.page,
}) })
processIssues(currentEntryIssues, serverKey, writtenEndpoint) processIssues(
currentEntryIssues,
serverKey,
writtenEndpoint,
false,
logErrors
)
} finally { } finally {
// TODO subscriptions should only be caused by the WebSocket connections // TODO subscriptions should only be caused by the WebSocket connections
// otherwise we don't known when to unsubscribe and this leaking // otherwise we don't known when to unsubscribe and this leaking
...@@ -410,7 +438,7 @@ export async function handleRouteType({ ...@@ -410,7 +438,7 @@ export async function handleRouteType({
pageEntrypoints: entrypoints.page, pageEntrypoints: entrypoints.page,
}) })
processIssues(currentEntryIssues, key, writtenEndpoint, true) processIssues(currentEntryIssues, key, writtenEndpoint, true, logErrors)
break break
} }
...@@ -454,7 +482,7 @@ export async function handleRouteType({ ...@@ -454,7 +482,7 @@ export async function handleRouteType({
pageEntrypoints: entrypoints.page, pageEntrypoints: entrypoints.page,
}) })
processIssues(currentEntryIssues, key, writtenEndpoint, dev) processIssues(currentEntryIssues, key, writtenEndpoint, dev, logErrors)
break break
} }
...@@ -477,7 +505,7 @@ export async function handleRouteType({ ...@@ -477,7 +505,7 @@ export async function handleRouteType({
rewrites, rewrites,
pageEntrypoints: entrypoints.page, pageEntrypoints: entrypoints.page,
}) })
processIssues(currentEntryIssues, key, writtenEndpoint, true) processIssues(currentEntryIssues, key, writtenEndpoint, true, logErrors)
break break
} }
...@@ -631,7 +659,7 @@ export async function handleEntrypoints({ ...@@ -631,7 +659,7 @@ export async function handleEntrypoints({
manifestLoader, manifestLoader,
nextConfig, nextConfig,
rewrites, rewrites,
logErrors,
dev, dev,
}: { }: {
entrypoints: TurbopackResult<RawEntrypoints> entrypoints: TurbopackResult<RawEntrypoints>
...@@ -642,6 +670,7 @@ export async function handleEntrypoints({ ...@@ -642,6 +670,7 @@ export async function handleEntrypoints({
manifestLoader: TurbopackManifestLoader manifestLoader: TurbopackManifestLoader
nextConfig: NextConfigComplete nextConfig: NextConfigComplete
rewrites: SetupOpts['fsChecker']['rewrites'] rewrites: SetupOpts['fsChecker']['rewrites']
logErrors: boolean
dev?: HandleEntrypointsDevOpts dev?: HandleEntrypointsDevOpts
}) { }) {
...@@ -719,7 +748,7 @@ export async function handleEntrypoints({ ...@@ -719,7 +748,7 @@ export async function handleEntrypoints({
const writtenEndpoint = await instrumentation[prop].writeToDisk() const writtenEndpoint = await instrumentation[prop].writeToDisk()
dev?.hooks.handleWrittenEndpoint(key, writtenEndpoint) dev?.hooks.handleWrittenEndpoint(key, writtenEndpoint)
processIssues(currentEntryIssues, key, writtenEndpoint) processIssues(currentEntryIssues, key, writtenEndpoint, false, logErrors)
} }
await processInstrumentation('instrumentation.nodeJs', 'nodeJs') await processInstrumentation('instrumentation.nodeJs', 'nodeJs')
await processInstrumentation('instrumentation.edge', 'edge') await processInstrumentation('instrumentation.edge', 'edge')
...@@ -757,7 +786,7 @@ export async function handleEntrypoints({ ...@@ -757,7 +786,7 @@ export async function handleEntrypoints({
async function processMiddleware() { async function processMiddleware() {
const writtenEndpoint = await endpoint.writeToDisk() const writtenEndpoint = await endpoint.writeToDisk()
dev?.hooks.handleWrittenEndpoint(key, writtenEndpoint) dev?.hooks.handleWrittenEndpoint(key, writtenEndpoint)
processIssues(currentEntryIssues, key, writtenEndpoint) processIssues(currentEntryIssues, key, writtenEndpoint, false, logErrors)
await manifestLoader.loadMiddlewareManifest('middleware', 'middleware') await manifestLoader.loadMiddlewareManifest('middleware', 'middleware')
if (dev) { if (dev) {
dev.serverFields.middleware = { dev.serverFields.middleware = {
...@@ -880,6 +909,7 @@ export async function handlePagesErrorRoute({ ...@@ -880,6 +909,7 @@ export async function handlePagesErrorRoute({
entrypoints, entrypoints,
manifestLoader, manifestLoader,
rewrites, rewrites,
logErrors,
hooks, hooks,
}: { }: {
...@@ -887,6 +917,7 @@ export async function handlePagesErrorRoute({ ...@@ -887,6 +917,7 @@ export async function handlePagesErrorRoute({
entrypoints: Entrypoints entrypoints: Entrypoints
manifestLoader: TurbopackManifestLoader manifestLoader: TurbopackManifestLoader
rewrites: SetupOpts['fsChecker']['rewrites'] rewrites: SetupOpts['fsChecker']['rewrites']
logErrors: boolean
hooks?: HandleRouteTypeHooks // dev hooks?: HandleRouteTypeHooks // dev
}) { }) {
...@@ -900,7 +931,7 @@ export async function handlePagesErrorRoute({ ...@@ -900,7 +931,7 @@ export async function handlePagesErrorRoute({
// https://github.com/vercel/next.js/blob/08d7a7e5189a835f5dcb82af026174e587575c0e/packages/next/src/client/page-bootstrap.ts#L69-L71 // https://github.com/vercel/next.js/blob/08d7a7e5189a835f5dcb82af026174e587575c0e/packages/next/src/client/page-bootstrap.ts#L69-L71
return { event: HMR_ACTIONS_SENT_TO_BROWSER.CLIENT_CHANGES } return { event: HMR_ACTIONS_SENT_TO_BROWSER.CLIENT_CHANGES }
}) })
processIssues(currentEntryIssues, key, writtenEndpoint) processIssues(currentEntryIssues, key, writtenEndpoint, false, logErrors)
} }
await manifestLoader.loadBuildManifest('_app') await manifestLoader.loadBuildManifest('_app')
await manifestLoader.loadPagesManifest('_app') await manifestLoader.loadPagesManifest('_app')
...@@ -914,7 +945,7 @@ export async function handlePagesErrorRoute({ ...@@ -914,7 +945,7 @@ export async function handlePagesErrorRoute({
hooks?.subscribeToChanges(key, false, entrypoints.global.document, () => { hooks?.subscribeToChanges(key, false, entrypoints.global.document, () => {
return { action: HMR_ACTIONS_SENT_TO_BROWSER.RELOAD_PAGE } return { action: HMR_ACTIONS_SENT_TO_BROWSER.RELOAD_PAGE }
}) })
processIssues(currentEntryIssues, key, writtenEndpoint) processIssues(currentEntryIssues, key, writtenEndpoint, false, logErrors)
} }
await manifestLoader.loadPagesManifest('_document') await manifestLoader.loadPagesManifest('_document')
...@@ -928,7 +959,7 @@ export async function handlePagesErrorRoute({ ...@@ -928,7 +959,7 @@ export async function handlePagesErrorRoute({
// https://github.com/vercel/next.js/blob/08d7a7e5189a835f5dcb82af026174e587575c0e/packages/next/src/client/page-bootstrap.ts#L69-L71 // https://github.com/vercel/next.js/blob/08d7a7e5189a835f5dcb82af026174e587575c0e/packages/next/src/client/page-bootstrap.ts#L69-L71
return { event: HMR_ACTIONS_SENT_TO_BROWSER.CLIENT_CHANGES } return { event: HMR_ACTIONS_SENT_TO_BROWSER.CLIENT_CHANGES }
}) })
processIssues(currentEntryIssues, key, writtenEndpoint) processIssues(currentEntryIssues, key, writtenEndpoint, false, logErrors)
} }
await manifestLoader.loadBuildManifest('_error') await manifestLoader.loadBuildManifest('_error')
await manifestLoader.loadPagesManifest('_error') await manifestLoader.loadPagesManifest('_error')
......
...@@ -322,7 +322,7 @@ export async function startServer( ...@@ -322,7 +322,7 @@ export async function startServer(
if (process.env.TURBOPACK) { if (process.env.TURBOPACK) {
await validateTurboNextConfig({ await validateTurboNextConfig({
...serverOptions, dir: serverOptions.dir,
isDev: true, isDev: true,
}) })
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment