Update stalled ensure log to use debug instead (#39826)

This updates the stalled ensure log to use debug instead the log isn't really actionable by the user and is more so meant for debugging purposes.
x-ref: slack thread
This commit is contained in:
JJ Kasper 2022-08-22 11:32:30 -05:00 committed by GitHub
parent b431bd4ba0
commit 4955da9eed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,5 +1,5 @@
import type ws from 'ws'
import * as Log from '../../build/output/log'
import origDebug from 'next/dist/compiled/debug'
import type { webpack } from 'next/dist/compiled/webpack/webpack'
import type { NextConfigComplete } from '../config-shared'
import { EventEmitter } from 'events'
@ -23,6 +23,8 @@ import {
COMPILER_NAMES,
} from '../../shared/lib/constants'
const debug = origDebug('next:on-demand-entry-handler')
/**
* Returns object keys with type inferred from the object key
*/
@ -517,7 +519,7 @@ export function onDemandEntryHandler({
async ensurePage(page: string, clientOnly: boolean): Promise<void> {
const stalledTime = 60
const stalledEnsureTimeout = setTimeout(() => {
Log.warn(
debug(
`Ensuring ${page} has taken longer than ${stalledTime}s, if this continues to stall this may be a bug`
)
}, stalledTime * 1000)