| Linux premium331.web-hosting.com 4.18.0-553.80.1.lve.el8.x86_64 #1 SMP Wed Oct 22 19:29:36 UTC 2025 x86_64 Path : /home/livedhms/lmgt/node_modules/next/dist/server/dev/ |
| Current File : //home/livedhms/lmgt/node_modules/next/dist/server/dev/hot-reloader-turbopack.js.map |
{"version":3,"sources":["../../../src/server/dev/hot-reloader-turbopack.ts"],"sourcesContent":["import type { Socket } from 'net'\nimport { mkdir, writeFile } from 'fs/promises'\nimport { join, extname, relative } from 'path'\nimport { pathToFileURL } from 'url'\n\nimport ws from 'next/dist/compiled/ws'\n\nimport type { OutputState } from '../../build/output/store'\nimport { store as consoleStore } from '../../build/output/store'\nimport type {\n CompilationError,\n HmrMessageSentToBrowser,\n NextJsHotReloaderInterface,\n ReloadPageMessage,\n SyncMessage,\n TurbopackConnectedMessage,\n} from './hot-reloader-types'\nimport { HMR_MESSAGE_SENT_TO_BROWSER } from './hot-reloader-types'\nimport type {\n Update as TurbopackUpdate,\n Endpoint,\n WrittenEndpoint,\n TurbopackResult,\n Project,\n Entrypoints,\n} from '../../build/swc/types'\nimport { createDefineEnv, getBindingsSync } from '../../build/swc'\nimport * as Log from '../../build/output/log'\nimport { BLOCKED_PAGES } from '../../shared/lib/constants'\nimport {\n getOverlayMiddleware,\n getSourceMapMiddleware,\n getOriginalStackFrames,\n} from './middleware-turbopack'\nimport { PageNotFoundError } from '../../shared/lib/utils'\nimport { debounce } from '../utils'\nimport { deleteCache } from './require-cache'\nimport {\n clearAllModuleContexts,\n clearModuleContext,\n} from '../lib/render-server'\nimport { denormalizePagePath } from '../../shared/lib/page-path/denormalize-page-path'\nimport { trace } from '../../trace'\nimport {\n AssetMapper,\n type ChangeSubscriptions,\n type ClientState,\n handleEntrypoints,\n handlePagesErrorRoute,\n handleRouteType,\n hasEntrypointForKey,\n msToNs,\n type ReadyIds,\n type SendHmr,\n type StartBuilding,\n processTopLevelIssues,\n printNonFatalIssue,\n normalizedPageToTurbopackStructureRoute,\n} from './turbopack-utils'\nimport {\n propagateServerField,\n type ServerFields,\n type SetupOpts,\n} from '../lib/router-utils/setup-dev-bundler'\nimport { TurbopackManifestLoader } from '../../shared/lib/turbopack/manifest-loader'\nimport { findPagePathData } from './on-demand-entry-handler'\nimport type { RouteDefinition } from '../route-definitions/route-definition'\nimport {\n type EntryKey,\n getEntryKey,\n splitEntryKey,\n} from '../../shared/lib/turbopack/entry-key'\nimport {\n createBinaryHmrMessageData,\n FAST_REFRESH_RUNTIME_RELOAD,\n} from './messages'\nimport { generateEncryptionKeyBase64 } from '../app-render/encryption-utils-server'\nimport { isAppPageRouteDefinition } from '../route-definitions/app-page-route-definition'\nimport { normalizeAppPath } from '../../shared/lib/router/utils/app-paths'\nimport type { ModernSourceMapPayload } from '../lib/source-maps'\nimport { getNodeDebugType, getParsedNodeOptions } from '../lib/utils'\nimport { isMetadataRouteFile } from '../../lib/metadata/is-metadata-route'\nimport { setBundlerFindSourceMapImplementation } from '../patch-error-inspect'\nimport { getNextErrorFeedbackMiddleware } from '../../next-devtools/server/get-next-error-feedback-middleware'\nimport {\n formatIssue,\n isFileSystemCacheEnabledForDev,\n isWellKnownError,\n processIssues,\n renderStyledStringToErrorAnsi,\n type EntryIssuesMap,\n type IssuesMap,\n type TopLevelIssuesMap,\n} from '../../shared/lib/turbopack/utils'\nimport { getDevOverlayFontMiddleware } from '../../next-devtools/server/font/get-dev-overlay-font-middleware'\nimport { devIndicatorServerState } from './dev-indicator-server-state'\nimport { getDisableDevIndicatorMiddleware } from '../../next-devtools/server/dev-indicator-middleware'\nimport { getRestartDevServerMiddleware } from '../../next-devtools/server/restart-dev-server-middleware'\nimport { backgroundLogCompilationEvents } from '../../shared/lib/turbopack/compilation-events'\nimport { getSupportedBrowsers, printBuildErrors } from '../../build/utils'\nimport {\n receiveBrowserLogsTurbopack,\n handleClientFileLogs,\n} from './browser-logs/receive-logs'\nimport { normalizePath } from '../../lib/normalize-path'\nimport {\n devToolsConfigMiddleware,\n getDevToolsConfig,\n} from '../../next-devtools/server/devtools-config-middleware'\nimport {\n connectReactDebugChannel,\n connectReactDebugChannelForHtmlRequest,\n deleteReactDebugChannelForHtmlRequest,\n setReactDebugChannelForHtmlRequest,\n} from './debug-channel'\nimport {\n getVersionInfo,\n matchNextPageBundleRequest,\n} from './hot-reloader-shared-utils'\nimport { getMcpMiddleware } from '../mcp/get-mcp-middleware'\nimport { handleErrorStateResponse } from '../mcp/tools/get-errors'\nimport { handlePageMetadataResponse } from '../mcp/tools/get-page-metadata'\nimport { setStackFrameResolver } from '../mcp/tools/utils/format-errors'\nimport { recordMcpTelemetry } from '../mcp/mcp-telemetry-tracker'\nimport { getFileLogger } from './browser-logs/file-logger'\nimport type { ServerCacheStatus } from '../../next-devtools/dev-overlay/cache-indicator'\nimport type { Lockfile } from '../../build/lockfile'\n\nconst wsServer = new ws.Server({ noServer: true })\nconst isTestMode = !!(\n process.env.NEXT_TEST_MODE ||\n process.env.__NEXT_TEST_MODE ||\n process.env.DEBUG\n)\n\nconst sessionId = Math.floor(Number.MAX_SAFE_INTEGER * Math.random())\n\ndeclare const __next__clear_chunk_cache__: (() => void) | null | undefined\n\n/**\n * Replaces turbopack:///[project] with the specified project in the `source` field.\n */\nfunction rewriteTurbopackSources(\n projectRoot: string,\n sourceMap: ModernSourceMapPayload\n): void {\n if ('sections' in sourceMap) {\n for (const section of sourceMap.sections) {\n rewriteTurbopackSources(projectRoot, section.map)\n }\n } else {\n for (let i = 0; i < sourceMap.sources.length; i++) {\n sourceMap.sources[i] = pathToFileURL(\n join(\n projectRoot,\n sourceMap.sources[i].replace(/turbopack:\\/\\/\\/\\[project\\]/, '')\n )\n ).toString()\n }\n }\n}\n\nfunction getSourceMapFromTurbopack(\n project: Project,\n projectRoot: string,\n sourceURL: string\n): ModernSourceMapPayload | undefined {\n let sourceMapJson: string | null = null\n\n try {\n sourceMapJson = project.getSourceMapSync(sourceURL)\n } catch (err) {}\n\n if (sourceMapJson === null) {\n return undefined\n } else {\n const payload: ModernSourceMapPayload = JSON.parse(sourceMapJson)\n // The sourcemap from Turbopack is not yet written to disk so its `sources`\n // are not absolute paths yet. We need to rewrite them to be absolute paths.\n rewriteTurbopackSources(projectRoot, payload)\n return payload\n }\n}\n\nexport async function createHotReloaderTurbopack(\n opts: SetupOpts & { isSrcDir: boolean },\n serverFields: ServerFields,\n distDir: string,\n resetFetch: () => void,\n lockfile: Lockfile | undefined\n): Promise<NextJsHotReloaderInterface> {\n const dev = true\n const buildId = 'development'\n const { nextConfig, dir: projectPath } = opts\n\n const bindings = getBindingsSync()\n\n // For the debugging purpose, check if createNext or equivalent next instance setup in test cases\n // works correctly. Normally `run-test` hides output so only will be visible when `--debug` flag is used.\n if (isTestMode) {\n ;(require('console') as typeof import('console')).log(\n 'Creating turbopack project',\n {\n dir: projectPath,\n testMode: isTestMode,\n }\n )\n }\n\n const hasRewrites =\n opts.fsChecker.rewrites.afterFiles.length > 0 ||\n opts.fsChecker.rewrites.beforeFiles.length > 0 ||\n opts.fsChecker.rewrites.fallback.length > 0\n\n const hotReloaderSpan = trace('hot-reloader', undefined, {\n version: process.env.__NEXT_VERSION as string,\n })\n // Ensure the hotReloaderSpan is flushed immediately as it's the parentSpan for all processing\n // of the current `next dev` invocation.\n hotReloaderSpan.stop()\n\n // Initialize log monitor for file logging\n // Enable logging by default in development mode\n const mcpServerEnabled = !!nextConfig.experimental.mcpServer\n const fileLogger = getFileLogger()\n fileLogger.initialize(distDir, mcpServerEnabled)\n\n const encryptionKey = await generateEncryptionKeyBase64({\n isBuild: false,\n distDir,\n })\n\n // TODO: Implement\n let clientRouterFilters: any\n if (nextConfig.experimental.clientRouterFilter) {\n // TODO this need to be set correctly for filesystem cache to work\n }\n\n const supportedBrowsers = getSupportedBrowsers(projectPath, dev)\n const currentNodeJsVersion = process.versions.node\n\n const rootPath =\n opts.nextConfig.turbopack?.root ||\n opts.nextConfig.outputFileTracingRoot ||\n projectPath\n const project = await bindings.turbo.createProject(\n {\n rootPath,\n projectPath: normalizePath(relative(rootPath, projectPath) || '.'),\n distDir,\n nextConfig: opts.nextConfig,\n watch: {\n enable: dev,\n pollIntervalMs: nextConfig.watchOptions?.pollIntervalMs,\n },\n dev,\n env: process.env as Record<string, string>,\n defineEnv: createDefineEnv({\n isTurbopack: true,\n clientRouterFilters,\n config: nextConfig,\n dev,\n distDir,\n projectPath,\n fetchCacheKeyPrefix: opts.nextConfig.experimental.fetchCacheKeyPrefix,\n hasRewrites,\n // TODO: Implement\n middlewareMatchers: undefined,\n rewrites: opts.fsChecker.rewrites,\n }),\n buildId,\n encryptionKey,\n previewProps: opts.fsChecker.prerenderManifest.preview,\n browserslistQuery: supportedBrowsers.join(', '),\n noMangling: false,\n currentNodeJsVersion,\n },\n {\n persistentCaching: isFileSystemCacheEnabledForDev(opts.nextConfig),\n memoryLimit: opts.nextConfig.experimental?.turbopackMemoryLimit,\n isShortSession: false,\n }\n )\n backgroundLogCompilationEvents(project, {\n eventTypes: ['StartupCacheInvalidationEvent', 'TimingEvent'],\n })\n setBundlerFindSourceMapImplementation(\n getSourceMapFromTurbopack.bind(null, project, projectPath)\n )\n opts.onDevServerCleanup?.(async () => {\n setBundlerFindSourceMapImplementation(() => undefined)\n await project.onExit()\n await lockfile?.unlock()\n })\n const entrypointsSubscription = project.entrypointsSubscribe()\n\n const currentWrittenEntrypoints: Map<EntryKey, WrittenEndpoint> = new Map()\n const currentEntrypoints: Entrypoints = {\n global: {\n app: undefined,\n document: undefined,\n error: undefined,\n\n middleware: undefined,\n instrumentation: undefined,\n },\n\n page: new Map(),\n app: new Map(),\n }\n\n const currentTopLevelIssues: TopLevelIssuesMap = new Map()\n const currentEntryIssues: EntryIssuesMap = new Map()\n\n const manifestLoader = new TurbopackManifestLoader({\n buildId,\n distDir,\n encryptionKey,\n })\n\n // Dev specific\n const changeSubscriptions: ChangeSubscriptions = new Map()\n const serverPathState = new Map<string, string>()\n const readyIds: ReadyIds = new Set()\n let currentEntriesHandlingResolve: ((value?: unknown) => void) | undefined\n let currentEntriesHandling = new Promise(\n (resolve) => (currentEntriesHandlingResolve = resolve)\n )\n\n const assetMapper = new AssetMapper()\n\n function clearRequireCache(\n key: EntryKey,\n writtenEndpoint: WrittenEndpoint,\n {\n force,\n }: {\n // Always clear the cache, don't check if files have changed\n force?: boolean\n } = {}\n ): boolean {\n if (force) {\n for (const { path, contentHash } of writtenEndpoint.serverPaths) {\n // We ignore source maps\n if (path.endsWith('.map')) continue\n const localKey = `${key}:${path}`\n serverPathState.set(localKey, contentHash)\n serverPathState.set(path, contentHash)\n }\n } else {\n // Figure out if the server files have changed\n let hasChange = false\n for (const { path, contentHash } of writtenEndpoint.serverPaths) {\n // We ignore source maps\n if (path.endsWith('.map')) continue\n const localKey = `${key}:${path}`\n const localHash = serverPathState.get(localKey)\n const globalHash = serverPathState.get(path)\n if (\n (localHash && localHash !== contentHash) ||\n (globalHash && globalHash !== contentHash)\n ) {\n hasChange = true\n serverPathState.set(localKey, contentHash)\n serverPathState.set(path, contentHash)\n } else {\n if (!localHash) {\n serverPathState.set(localKey, contentHash)\n }\n if (!globalHash) {\n serverPathState.set(path, contentHash)\n }\n }\n }\n\n if (!hasChange) {\n return false\n }\n }\n\n resetFetch()\n\n // Not available in:\n // - Pages Router (no server-side HMR)\n // - Edge Runtime (uses browser runtime which already disposes chunks individually)\n if (typeof __next__clear_chunk_cache__ === 'function') {\n __next__clear_chunk_cache__()\n }\n\n const serverPaths = writtenEndpoint.serverPaths.map(({ path: p }) =>\n join(distDir, p)\n )\n\n for (const file of serverPaths) {\n clearModuleContext(file)\n deleteCache(file)\n }\n\n return true\n }\n\n const buildingIds = new Set()\n\n const startBuilding: StartBuilding = (id, requestUrl, forceRebuild) => {\n if (!forceRebuild && readyIds.has(id)) {\n return () => {}\n }\n if (buildingIds.size === 0) {\n consoleStore.setState(\n {\n loading: true,\n trigger: id,\n url: requestUrl,\n } as OutputState,\n true\n )\n }\n buildingIds.add(id)\n return function finishBuilding() {\n if (buildingIds.size === 0) {\n return\n }\n readyIds.add(id)\n buildingIds.delete(id)\n if (buildingIds.size === 0) {\n hmrEventHappened = false\n consoleStore.setState(\n {\n loading: false,\n } as OutputState,\n true\n )\n }\n }\n }\n\n let hmrEventHappened = false\n let hmrHash = 0\n\n const clientsWithoutHtmlRequestId = new Set<ws>()\n const clientsByHtmlRequestId = new Map<string, ws>()\n const cacheStatusesByHtmlRequestId = new Map<string, ServerCacheStatus>()\n const clientStates = new WeakMap<ws, ClientState>()\n\n function sendToClient(client: ws, message: HmrMessageSentToBrowser) {\n const data =\n typeof message.type === 'number'\n ? createBinaryHmrMessageData(message)\n : JSON.stringify(message)\n\n client.send(data)\n }\n\n function sendEnqueuedMessages() {\n for (const [, issueMap] of currentEntryIssues) {\n if (\n [...issueMap.values()].filter((i) => i.severity !== 'warning').length >\n 0\n ) {\n // During compilation errors we want to delay the HMR events until errors are fixed\n return\n }\n }\n\n for (const client of [\n ...clientsWithoutHtmlRequestId,\n ...clientsByHtmlRequestId.values(),\n ]) {\n const state = clientStates.get(client)\n if (!state) {\n continue\n }\n\n for (const [, issueMap] of state.clientIssues) {\n if (\n [...issueMap.values()].filter((i) => i.severity !== 'warning')\n .length > 0\n ) {\n // During compilation errors we want to delay the HMR events until errors are fixed\n return\n }\n }\n\n for (const message of state.messages.values()) {\n sendToClient(client, message)\n }\n state.messages.clear()\n\n if (state.turbopackUpdates.length > 0) {\n sendToClient(client, {\n type: HMR_MESSAGE_SENT_TO_BROWSER.TURBOPACK_MESSAGE,\n data: state.turbopackUpdates,\n })\n state.turbopackUpdates.length = 0\n }\n }\n }\n const sendEnqueuedMessagesDebounce = debounce(sendEnqueuedMessages, 2)\n\n const sendHmr: SendHmr = (id: string, message: HmrMessageSentToBrowser) => {\n for (const client of [\n ...clientsWithoutHtmlRequestId,\n ...clientsByHtmlRequestId.values(),\n ]) {\n clientStates.get(client)?.messages.set(id, message)\n }\n\n hmrEventHappened = true\n sendEnqueuedMessagesDebounce()\n }\n\n function sendTurbopackMessage(payload: TurbopackUpdate) {\n // TODO(PACK-2049): For some reason we end up emitting hundreds of issues messages on bigger apps,\n // a lot of which are duplicates.\n // They are currently not handled on the client at all, so might as well not send them for now.\n payload.diagnostics = []\n payload.issues = []\n\n for (const client of [\n ...clientsWithoutHtmlRequestId,\n ...clientsByHtmlRequestId.values(),\n ]) {\n clientStates.get(client)?.turbopackUpdates.push(payload)\n }\n\n hmrEventHappened = true\n sendEnqueuedMessagesDebounce()\n }\n\n async function subscribeToChanges(\n key: EntryKey,\n includeIssues: boolean,\n endpoint: Endpoint,\n createMessage: (\n change: TurbopackResult,\n hash: string\n ) => Promise<HmrMessageSentToBrowser> | HmrMessageSentToBrowser | void,\n onError?: (\n error: Error\n ) => Promise<HmrMessageSentToBrowser> | HmrMessageSentToBrowser | void\n ) {\n if (changeSubscriptions.has(key)) {\n return\n }\n\n const { side } = splitEntryKey(key)\n\n const changedPromise = endpoint[`${side}Changed`](includeIssues)\n changeSubscriptions.set(key, changedPromise)\n try {\n const changed = await changedPromise\n\n for await (const change of changed) {\n processIssues(currentEntryIssues, key, change, false, true)\n // TODO: Get an actual content hash from Turbopack.\n const message = await createMessage(change, String(++hmrHash))\n if (message) {\n sendHmr(key, message)\n }\n }\n } catch (e) {\n changeSubscriptions.delete(key)\n const payload = await onError?.(e as Error)\n if (payload) {\n sendHmr(key, payload)\n }\n return\n }\n changeSubscriptions.delete(key)\n }\n\n async function unsubscribeFromChanges(key: EntryKey) {\n const subscription = await changeSubscriptions.get(key)\n if (subscription) {\n await subscription.return?.()\n changeSubscriptions.delete(key)\n }\n currentEntryIssues.delete(key)\n }\n\n async function subscribeToHmrEvents(client: ws, id: string) {\n const key = getEntryKey('assets', 'client', id)\n if (!hasEntrypointForKey(currentEntrypoints, key, assetMapper)) {\n // maybe throw an error / force the client to reload?\n return\n }\n\n const state = clientStates.get(client)\n if (!state || state.subscriptions.has(id)) {\n return\n }\n\n const subscription = project!.hmrEvents(id)\n state.subscriptions.set(id, subscription)\n\n // The subscription will always emit once, which is the initial\n // computation. This is not a change, so swallow it.\n try {\n await subscription.next()\n\n for await (const data of subscription) {\n processIssues(state.clientIssues, key, data, false, true)\n if (data.type !== 'issues') {\n sendTurbopackMessage(data)\n }\n }\n } catch (e) {\n // The client might be using an HMR session from a previous server, tell them\n // to fully reload the page to resolve the issue. We can't use\n // `hotReloader.send` since that would force every connected client to\n // reload, only this client is out of date.\n const reloadMessage: ReloadPageMessage = {\n type: HMR_MESSAGE_SENT_TO_BROWSER.RELOAD_PAGE,\n data: `error in HMR event subscription for ${id}: ${e}`,\n }\n sendToClient(client, reloadMessage)\n client.close()\n return\n }\n }\n\n function unsubscribeFromHmrEvents(client: ws, id: string) {\n const state = clientStates.get(client)\n if (!state) {\n return\n }\n\n const subscription = state.subscriptions.get(id)\n subscription?.return!()\n\n const key = getEntryKey('assets', 'client', id)\n state.clientIssues.delete(key)\n }\n\n async function handleEntrypointsSubscription() {\n for await (const entrypoints of entrypointsSubscription) {\n if (!currentEntriesHandlingResolve) {\n currentEntriesHandling = new Promise(\n // eslint-disable-next-line no-loop-func\n (resolve) => (currentEntriesHandlingResolve = resolve)\n )\n }\n\n // Always process issues/diagnostics, even if there are no entrypoints yet\n processTopLevelIssues(currentTopLevelIssues, entrypoints)\n\n // Certain crtical issues prevent any entrypoints from being constructed so return early\n if (!('routes' in entrypoints)) {\n printBuildErrors(entrypoints, true)\n\n currentEntriesHandlingResolve!()\n currentEntriesHandlingResolve = undefined\n continue\n }\n\n const routes = entrypoints.routes\n const existingRoutes = [\n ...currentEntrypoints.app.keys(),\n ...currentEntrypoints.page.keys(),\n ]\n const newRoutes = [...routes.keys()]\n\n const addedRoutes = newRoutes.filter(\n (route) =>\n !currentEntrypoints.app.has(route) &&\n !currentEntrypoints.page.has(route)\n )\n const removedRoutes = existingRoutes.filter((route) => !routes.has(route))\n\n await handleEntrypoints({\n entrypoints: entrypoints as any,\n\n currentEntrypoints,\n\n currentEntryIssues,\n manifestLoader,\n devRewrites: opts.fsChecker.rewrites,\n productionRewrites: undefined,\n logErrors: true,\n\n dev: {\n assetMapper,\n changeSubscriptions,\n clients: [\n ...clientsWithoutHtmlRequestId,\n ...clientsByHtmlRequestId.values(),\n ],\n clientStates,\n serverFields,\n\n hooks: {\n handleWrittenEndpoint: (id, result, forceDeleteCache) => {\n currentWrittenEntrypoints.set(id, result)\n return clearRequireCache(id, result, { force: forceDeleteCache })\n },\n propagateServerField: propagateServerField.bind(null, opts),\n sendHmr,\n startBuilding,\n subscribeToChanges,\n unsubscribeFromChanges,\n unsubscribeFromHmrEvents,\n },\n },\n })\n\n // Reload matchers when the files have been compiled\n await propagateServerField(opts, 'reloadMatchers', undefined)\n\n if (addedRoutes.length > 0 || removedRoutes.length > 0) {\n // When the list of routes changes a new manifest should be fetched for Pages Router.\n hotReloader.send({\n type: HMR_MESSAGE_SENT_TO_BROWSER.DEV_PAGES_MANIFEST_UPDATE,\n data: [\n {\n devPagesManifest: true,\n },\n ],\n })\n }\n\n for (const route of addedRoutes) {\n hotReloader.send({\n type: HMR_MESSAGE_SENT_TO_BROWSER.ADDED_PAGE,\n data: [route],\n })\n }\n\n for (const route of removedRoutes) {\n hotReloader.send({\n type: HMR_MESSAGE_SENT_TO_BROWSER.REMOVED_PAGE,\n data: [route],\n })\n }\n\n currentEntriesHandlingResolve!()\n currentEntriesHandlingResolve = undefined\n }\n }\n\n await mkdir(join(distDir, 'server'), { recursive: true })\n await mkdir(join(distDir, 'static', buildId), { recursive: true })\n await writeFile(\n join(distDir, 'package.json'),\n JSON.stringify(\n {\n type: 'commonjs',\n },\n null,\n 2\n )\n )\n\n const middlewares = [\n getOverlayMiddleware({\n project,\n projectPath,\n isSrcDir: opts.isSrcDir,\n }),\n getSourceMapMiddleware(project),\n getNextErrorFeedbackMiddleware(opts.telemetry),\n getDevOverlayFontMiddleware(),\n getDisableDevIndicatorMiddleware(),\n getRestartDevServerMiddleware({\n telemetry: opts.telemetry,\n turbopackProject: project,\n }),\n devToolsConfigMiddleware({\n distDir,\n sendUpdateSignal: (data) => {\n hotReloader.send({\n type: HMR_MESSAGE_SENT_TO_BROWSER.DEVTOOLS_CONFIG,\n data,\n })\n },\n }),\n ...(nextConfig.experimental.mcpServer\n ? [\n getMcpMiddleware({\n projectPath,\n distDir,\n nextConfig,\n pagesDir: opts.pagesDir,\n appDir: opts.appDir,\n sendHmrMessage: (message) => hotReloader.send(message),\n getActiveConnectionCount: () =>\n clientsWithoutHtmlRequestId.size + clientsByHtmlRequestId.size,\n getDevServerUrl: () => process.env.__NEXT_PRIVATE_ORIGIN,\n }),\n ]\n : []),\n ]\n\n setStackFrameResolver(async (request) => {\n return getOriginalStackFrames({\n project,\n projectPath,\n isServer: request.isServer,\n isEdgeServer: request.isEdgeServer,\n isAppDirectory: request.isAppDirectory,\n frames: request.frames,\n })\n })\n\n let versionInfoCached: ReturnType<typeof getVersionInfo> | undefined\n // This fetch, even though not awaited, is not kicked off eagerly because the first `fetch()` in\n // Node.js adds roughly 20ms main-thread blocking to load the SSL certificate cache\n // We don't want that blocking time to be in the hot path for the `ready in` logging.\n // Instead, the fetch is kicked off lazily when the first `getVersionInfoCached()` is called.\n const getVersionInfoCached = (): ReturnType<typeof getVersionInfo> => {\n if (!versionInfoCached) {\n versionInfoCached = getVersionInfo()\n }\n return versionInfoCached\n }\n\n let devtoolsFrontendUrl: string | undefined\n const nodeOptions = getParsedNodeOptions()\n const nodeDebugType = getNodeDebugType(nodeOptions)\n if (nodeDebugType) {\n const debugPort = process.debugPort\n let debugInfo\n try {\n // It requires to use 127.0.0.1 instead of localhost for server-side fetching.\n const debugInfoList = await fetch(\n `http://127.0.0.1:${debugPort}/json/list`\n ).then((res) => res.json())\n debugInfo = debugInfoList[0]\n } catch {}\n if (debugInfo) {\n devtoolsFrontendUrl = debugInfo.devtoolsFrontendUrl\n }\n }\n\n const hotReloader: NextJsHotReloaderInterface = {\n turbopackProject: project,\n activeWebpackConfigs: undefined,\n serverStats: null,\n edgeServerStats: null,\n async run(req, res, _parsedUrl) {\n // intercept page chunks request and ensure them with turbopack\n if (req.url?.startsWith('/_next/static/chunks/pages/')) {\n const params = matchNextPageBundleRequest(req.url)\n\n if (params) {\n const decodedPagePath = `/${params.path\n .map((param: string) => decodeURIComponent(param))\n .join('/')}`\n\n const denormalizedPagePath = denormalizePagePath(decodedPagePath)\n\n await hotReloader\n .ensurePage({\n page: denormalizedPagePath,\n clientOnly: false,\n definition: undefined,\n url: req.url,\n })\n .catch(console.error)\n }\n }\n\n for (const middleware of middlewares) {\n let calledNext = false\n\n await middleware(req, res, () => {\n calledNext = true\n })\n\n if (!calledNext) {\n return { finished: true }\n }\n }\n\n // Request was not finished.\n return { finished: undefined }\n },\n\n // TODO: Figure out if socket type can match the NextJsHotReloaderInterface\n onHMR(req, socket: Socket, head, onUpgrade) {\n wsServer.handleUpgrade(req, socket, head, (client) => {\n const clientIssues: EntryIssuesMap = new Map()\n const subscriptions: Map<string, AsyncIterator<any>> = new Map()\n\n const htmlRequestId = req.url\n ? new URL(req.url, 'http://n').searchParams.get('id')\n : null\n\n // Clients with a request ID are inferred App Router clients. If Cache\n // Components is not enabled, we consider those legacy clients. Pages\n // Router clients are also considered legacy clients. TODO: Maybe mark\n // clients as App Router / Pages Router clients explicitly, instead of\n // inferring it from the presence of a request ID.\n if (htmlRequestId) {\n clientsByHtmlRequestId.set(htmlRequestId, client)\n const enableCacheComponents = nextConfig.cacheComponents\n if (enableCacheComponents) {\n onUpgrade(client, { isLegacyClient: false })\n const cacheStatus = cacheStatusesByHtmlRequestId.get(htmlRequestId)\n if (cacheStatus !== undefined) {\n sendToClient(client, {\n type: HMR_MESSAGE_SENT_TO_BROWSER.CACHE_INDICATOR,\n state: cacheStatus,\n })\n cacheStatusesByHtmlRequestId.delete(htmlRequestId)\n }\n } else {\n onUpgrade(client, { isLegacyClient: true })\n }\n } else {\n clientsWithoutHtmlRequestId.add(client)\n onUpgrade(client, { isLegacyClient: true })\n }\n\n clientStates.set(client, {\n clientIssues,\n messages: new Map(),\n turbopackUpdates: [],\n subscriptions,\n })\n\n client.on('close', () => {\n // Remove active subscriptions\n for (const subscription of subscriptions.values()) {\n subscription.return?.()\n }\n clientStates.delete(client)\n\n if (htmlRequestId) {\n clientsByHtmlRequestId.delete(htmlRequestId)\n deleteReactDebugChannelForHtmlRequest(htmlRequestId)\n } else {\n clientsWithoutHtmlRequestId.delete(client)\n }\n })\n\n client.addEventListener('message', async ({ data }) => {\n const parsedData = JSON.parse(\n typeof data !== 'string' ? data.toString() : data\n )\n\n // Next.js messages\n switch (parsedData.event) {\n case 'span-end': {\n hotReloaderSpan.manualTraceChild(\n parsedData.spanName,\n msToNs(parsedData.startTime),\n msToNs(parsedData.endTime),\n parsedData.attributes\n )\n break\n }\n case 'client-hmr-latency': // { id, startTime, endTime, page, updatedModules, isPageHidden }\n hotReloaderSpan.manualTraceChild(\n parsedData.event,\n msToNs(parsedData.startTime),\n msToNs(parsedData.endTime),\n {\n updatedModules: parsedData.updatedModules,\n page: parsedData.page,\n isPageHidden: parsedData.isPageHidden,\n }\n )\n break\n\n case 'client-error': // { errorCount, clientId }\n case 'client-warning': // { warningCount, clientId }\n case 'client-success': // { clientId }\n case 'server-component-reload-page': // { clientId }\n case 'client-reload-page': // { clientId }\n case 'client-removed-page': // { page }\n case 'client-full-reload': // { stackTrace, hadRuntimeError }\n const { hadRuntimeError, dependencyChain } = parsedData\n if (hadRuntimeError) {\n Log.warn(FAST_REFRESH_RUNTIME_RELOAD)\n }\n if (\n Array.isArray(dependencyChain) &&\n typeof dependencyChain[0] === 'string'\n ) {\n const cleanedModulePath = dependencyChain[0]\n .replace(/^\\[project\\]/, '.')\n .replace(/ \\[.*\\] \\(.*\\)$/, '')\n Log.warn(\n `Fast Refresh had to perform a full reload when ${cleanedModulePath} changed. Read more: https://nextjs.org/docs/messages/fast-refresh-reload`\n )\n }\n break\n case 'client-added-page':\n // TODO\n break\n case 'browser-logs': {\n if (nextConfig.experimental.browserDebugInfoInTerminal) {\n await receiveBrowserLogsTurbopack({\n entries: parsedData.entries,\n router: parsedData.router,\n sourceType: parsedData.sourceType,\n project,\n projectPath,\n distDir,\n config: nextConfig.experimental.browserDebugInfoInTerminal,\n })\n }\n break\n }\n case 'client-file-logs': {\n // Always log to file regardless of terminal flag\n await handleClientFileLogs(parsedData.logs)\n break\n }\n case 'ping': {\n // Handle ping events to keep WebSocket connections alive\n // No-op - just acknowledge the ping\n break\n }\n\n case 'mcp-error-state-response': {\n handleErrorStateResponse(\n parsedData.requestId,\n parsedData.errorState,\n parsedData.url\n )\n break\n }\n\n case 'mcp-page-metadata-response': {\n handlePageMetadataResponse(\n parsedData.requestId,\n parsedData.segmentTrieData,\n parsedData.url\n )\n break\n }\n\n default:\n // Might be a Turbopack message...\n if (!parsedData.type) {\n throw new Error(`unrecognized HMR message \"${data}\"`)\n }\n }\n\n // Turbopack messages\n switch (parsedData.type) {\n case 'turbopack-subscribe':\n subscribeToHmrEvents(client, parsedData.path)\n break\n\n case 'turbopack-unsubscribe':\n unsubscribeFromHmrEvents(client, parsedData.path)\n break\n\n default:\n if (!parsedData.event) {\n throw new Error(`unrecognized Turbopack HMR message \"${data}\"`)\n }\n }\n })\n\n const turbopackConnectedMessage: TurbopackConnectedMessage = {\n type: HMR_MESSAGE_SENT_TO_BROWSER.TURBOPACK_CONNECTED,\n data: { sessionId },\n }\n sendToClient(client, turbopackConnectedMessage)\n\n const errors: CompilationError[] = []\n\n for (const entryIssues of currentEntryIssues.values()) {\n for (const issue of entryIssues.values()) {\n if (issue.severity !== 'warning') {\n errors.push({\n message: formatIssue(issue),\n })\n } else {\n printNonFatalIssue(issue)\n }\n }\n }\n\n if (devIndicatorServerState.disabledUntil < Date.now()) {\n devIndicatorServerState.disabledUntil = 0\n }\n\n ;(async function () {\n const versionInfo = await getVersionInfoCached()\n const devToolsConfig = await getDevToolsConfig(distDir)\n\n const syncMessage: SyncMessage = {\n type: HMR_MESSAGE_SENT_TO_BROWSER.SYNC,\n errors,\n warnings: [],\n hash: '',\n versionInfo,\n debug: {\n devtoolsFrontendUrl,\n },\n devIndicator: devIndicatorServerState,\n devToolsConfig,\n }\n\n sendToClient(client, syncMessage)\n\n if (htmlRequestId) {\n connectReactDebugChannelForHtmlRequest(\n htmlRequestId,\n sendToClient.bind(null, client)\n )\n }\n })()\n })\n },\n\n send(action) {\n const payload = JSON.stringify(action)\n\n for (const client of [\n ...clientsWithoutHtmlRequestId,\n ...clientsByHtmlRequestId.values(),\n ]) {\n client.send(payload)\n }\n },\n\n sendToLegacyClients(action) {\n const payload = JSON.stringify(action)\n\n // Clients with a request ID are inferred App Router clients. If Cache\n // Components is not enabled, we consider those legacy clients. Pages\n // Router clients are also considered legacy clients. TODO: Maybe mark\n // clients as App Router / Pages Router clients explicitly, instead of\n // inferring it from the presence of a request ID.\n\n if (!nextConfig.cacheComponents) {\n for (const client of clientsByHtmlRequestId.values()) {\n client.send(payload)\n }\n }\n\n for (const client of clientsWithoutHtmlRequestId) {\n client.send(payload)\n }\n },\n\n setCacheStatus(status: ServerCacheStatus, htmlRequestId: string): void {\n // Legacy clients don't have Cache Components.\n const client = clientsByHtmlRequestId.get(htmlRequestId)\n if (client !== undefined) {\n sendToClient(client, {\n type: HMR_MESSAGE_SENT_TO_BROWSER.CACHE_INDICATOR,\n state: status,\n })\n } else {\n // If the client is not connected, store the status so that we can send it\n // when the client connects.\n cacheStatusesByHtmlRequestId.set(htmlRequestId, status)\n }\n },\n\n setReactDebugChannel(debugChannel, htmlRequestId, requestId) {\n const client = clientsByHtmlRequestId.get(htmlRequestId)\n\n if (htmlRequestId === requestId) {\n // The debug channel is for the HTML request.\n if (client) {\n // If the client is connected, we can connect the debug channel for\n // the HTML request immediately.\n connectReactDebugChannel(\n htmlRequestId,\n debugChannel,\n sendToClient.bind(null, client)\n )\n } else {\n // Otherwise, we'll do that when the client connects and just store\n // the debug channel.\n setReactDebugChannelForHtmlRequest(htmlRequestId, debugChannel)\n }\n } else if (client) {\n // The debug channel is for a subsequent request (e.g. client-side\n // navigation for server function call). If the client is not connected\n // anymore, we don't need to connect the debug channel.\n connectReactDebugChannel(\n requestId,\n debugChannel,\n sendToClient.bind(null, client)\n )\n }\n },\n\n setHmrServerError(_error) {\n // Not implemented yet.\n },\n clearHmrServerError() {\n // Not implemented yet.\n },\n async start() {},\n async getCompilationErrors(page) {\n const appEntryKey = getEntryKey('app', 'server', page)\n const pagesEntryKey = getEntryKey('pages', 'server', page)\n\n const topLevelIssues = currentTopLevelIssues.values()\n\n const thisEntryIssues =\n currentEntryIssues.get(appEntryKey) ??\n currentEntryIssues.get(pagesEntryKey)\n\n if (thisEntryIssues !== undefined && thisEntryIssues.size > 0) {\n // If there is an error related to the requesting page we display it instead of the first error\n return [...topLevelIssues, ...thisEntryIssues.values()]\n .map((issue) => {\n const formattedIssue = formatIssue(issue)\n if (issue.severity === 'warning') {\n printNonFatalIssue(issue)\n return null\n } else if (isWellKnownError(issue)) {\n Log.error(formattedIssue)\n }\n\n return new Error(formattedIssue)\n })\n .filter((error) => error !== null)\n }\n\n // Otherwise, return all errors across pages\n const errors = []\n for (const issue of topLevelIssues) {\n if (issue.severity !== 'warning') {\n errors.push(new Error(formatIssue(issue)))\n }\n }\n for (const entryIssues of currentEntryIssues.values()) {\n for (const issue of entryIssues.values()) {\n if (issue.severity !== 'warning') {\n const message = formatIssue(issue)\n errors.push(new Error(message))\n } else {\n printNonFatalIssue(issue)\n }\n }\n }\n return errors\n },\n async invalidate({\n // .env files or tsconfig/jsconfig change\n reloadAfterInvalidation,\n }) {\n if (reloadAfterInvalidation) {\n for (const [key, entrypoint] of currentWrittenEntrypoints) {\n clearRequireCache(key, entrypoint, { force: true })\n }\n\n await clearAllModuleContexts()\n this.send({\n type: HMR_MESSAGE_SENT_TO_BROWSER.SERVER_COMPONENT_CHANGES,\n hash: String(++hmrHash),\n })\n }\n },\n async buildFallbackError() {\n // Not implemented yet.\n },\n async ensurePage({\n page: inputPage,\n // Unused parameters\n // clientOnly,\n appPaths,\n definition,\n isApp,\n url: requestUrl,\n }) {\n // When there is no route definition this is an internal file not a route the user added.\n // Middleware and instrumentation are handled in turbpack-utils.ts handleEntrypoints instead.\n if (!definition) {\n if (inputPage === '/middleware') return\n if (inputPage === '/src/middleware') return\n if (inputPage === '/instrumentation') return\n if (inputPage === '/src/instrumentation') return\n }\n\n return hotReloaderSpan\n .traceChild('ensure-page', {\n inputPage,\n })\n .traceAsyncFn(async () => {\n if (BLOCKED_PAGES.includes(inputPage) && inputPage !== '/_error') {\n return\n }\n\n await currentEntriesHandling\n\n // TODO We shouldn't look into the filesystem again. This should use the information from entrypoints\n let routeDef: Pick<\n RouteDefinition,\n 'filename' | 'bundlePath' | 'page'\n > =\n definition ??\n (await findPagePathData(\n projectPath,\n inputPage,\n nextConfig.pageExtensions,\n opts.pagesDir,\n opts.appDir,\n !!nextConfig.experimental.globalNotFound\n ))\n\n // If the route is actually an app page route, then we should have access\n // to the app route definition, and therefore, the appPaths from it.\n if (!appPaths && definition && isAppPageRouteDefinition(definition)) {\n appPaths = definition.appPaths\n }\n\n let page = routeDef.page\n if (appPaths) {\n const normalizedPage = normalizeAppPath(page)\n\n // filter out paths that are not exact matches (e.g. catchall)\n const matchingAppPaths = appPaths.filter(\n (path) => normalizeAppPath(path) === normalizedPage\n )\n\n // the last item in the array is the root page, if there are parallel routes\n page = matchingAppPaths[matchingAppPaths.length - 1]\n }\n\n const pathname = definition?.pathname ?? inputPage\n\n if (page === '/_error') {\n let finishBuilding = startBuilding(pathname, requestUrl, false)\n try {\n await handlePagesErrorRoute({\n currentEntryIssues,\n entrypoints: currentEntrypoints,\n manifestLoader,\n devRewrites: opts.fsChecker.rewrites,\n productionRewrites: undefined,\n logErrors: true,\n hooks: {\n subscribeToChanges,\n handleWrittenEndpoint: (id, result, forceDeleteCache) => {\n currentWrittenEntrypoints.set(id, result)\n assetMapper.setPathsForKey(id, result.clientPaths)\n return clearRequireCache(id, result, {\n force: forceDeleteCache,\n })\n },\n },\n })\n } finally {\n finishBuilding()\n }\n return\n }\n\n const isInsideAppDir = routeDef.bundlePath.startsWith('app/')\n const isEntryMetadataRouteFile = isMetadataRouteFile(\n routeDef.filename.replace(opts.appDir || '', ''),\n nextConfig.pageExtensions,\n true\n )\n const normalizedAppPage = isEntryMetadataRouteFile\n ? normalizedPageToTurbopackStructureRoute(\n page,\n extname(routeDef.filename)\n )\n : page\n\n const route = isInsideAppDir\n ? currentEntrypoints.app.get(normalizedAppPage)\n : currentEntrypoints.page.get(page)\n\n if (!route) {\n // TODO: why is this entry missing in turbopack?\n if (page === '/middleware') return\n if (page === '/src/middleware') return\n if (page === '/proxy') return\n if (page === '/src/proxy') return\n if (page === '/instrumentation') return\n if (page === '/src/instrumentation') return\n\n throw new PageNotFoundError(`route not found ${page}`)\n }\n\n // We don't throw on ensureOpts.isApp === true for page-api\n // since this can happen when app pages make\n // api requests to page API routes.\n if (isApp && route.type === 'page') {\n throw new Error(`mis-matched route type: isApp && page for ${page}`)\n }\n\n const finishBuilding = startBuilding(pathname, requestUrl, false)\n try {\n await handleRouteType({\n dev,\n page,\n pathname,\n route,\n currentEntryIssues,\n entrypoints: currentEntrypoints,\n manifestLoader,\n readyIds,\n devRewrites: opts.fsChecker.rewrites,\n productionRewrites: undefined,\n logErrors: true,\n\n hooks: {\n subscribeToChanges,\n handleWrittenEndpoint: (id, result, forceDeleteCache) => {\n currentWrittenEntrypoints.set(id, result)\n assetMapper.setPathsForKey(id, result.clientPaths)\n return clearRequireCache(id, result, {\n force: forceDeleteCache,\n })\n },\n },\n })\n } finally {\n finishBuilding()\n }\n })\n },\n close() {\n // Report MCP telemetry if MCP server is enabled\n recordMcpTelemetry(opts.telemetry)\n\n for (const wsClient of [\n ...clientsWithoutHtmlRequestId,\n ...clientsByHtmlRequestId.values(),\n ]) {\n // it's okay to not cleanly close these websocket connections, this is dev\n wsClient.terminate()\n }\n clientsWithoutHtmlRequestId.clear()\n clientsByHtmlRequestId.clear()\n },\n }\n\n handleEntrypointsSubscription().catch((err) => {\n console.error(err)\n process.exit(1)\n })\n\n // Write empty manifests\n await currentEntriesHandling\n await manifestLoader.writeManifests({\n devRewrites: opts.fsChecker.rewrites,\n productionRewrites: undefined,\n entrypoints: currentEntrypoints,\n })\n\n async function handleProjectUpdates() {\n for await (const updateMessage of project.updateInfoSubscribe(30)) {\n switch (updateMessage.updateType) {\n case 'start': {\n hotReloader.send({ type: HMR_MESSAGE_SENT_TO_BROWSER.BUILDING })\n break\n }\n case 'end': {\n sendEnqueuedMessages()\n\n function addToErrorsMap(\n errorsMap: Map<string, CompilationError>,\n issueMap: IssuesMap\n ) {\n for (const [key, issue] of issueMap) {\n if (issue.severity === 'warning') continue\n if (errorsMap.has(key)) continue\n\n const message = formatIssue(issue)\n\n errorsMap.set(key, {\n message,\n details: issue.detail\n ? renderStyledStringToErrorAnsi(issue.detail)\n : undefined,\n })\n }\n }\n\n function addErrors(\n errorsMap: Map<string, CompilationError>,\n issues: EntryIssuesMap\n ) {\n for (const issueMap of issues.values()) {\n addToErrorsMap(errorsMap, issueMap)\n }\n }\n\n const errors = new Map<string, CompilationError>()\n addToErrorsMap(errors, currentTopLevelIssues)\n addErrors(errors, currentEntryIssues)\n\n for (const client of [\n ...clientsWithoutHtmlRequestId,\n ...clientsByHtmlRequestId.values(),\n ]) {\n const state = clientStates.get(client)\n if (!state) {\n continue\n }\n\n const clientErrors = new Map(errors)\n addErrors(clientErrors, state.clientIssues)\n\n sendToClient(client, {\n type: HMR_MESSAGE_SENT_TO_BROWSER.BUILT,\n hash: String(++hmrHash),\n errors: [...clientErrors.values()],\n warnings: [],\n })\n }\n\n if (hmrEventHappened) {\n const time = updateMessage.value.duration\n const timeMessage =\n time > 2000 ? `${Math.round(time / 100) / 10}s` : `${time}ms`\n Log.event(`Compiled in ${timeMessage}`)\n hmrEventHappened = false\n }\n break\n }\n default:\n }\n }\n }\n\n handleProjectUpdates().catch((err) => {\n console.error(err)\n process.exit(1)\n })\n\n return hotReloader\n}\n"],"names":["createHotReloaderTurbopack","wsServer","ws","Server","noServer","isTestMode","process","env","NEXT_TEST_MODE","__NEXT_TEST_MODE","DEBUG","sessionId","Math","floor","Number","MAX_SAFE_INTEGER","random","rewriteTurbopackSources","projectRoot","sourceMap","section","sections","map","i","sources","length","pathToFileURL","join","replace","toString","getSourceMapFromTurbopack","project","sourceURL","sourceMapJson","getSourceMapSync","err","undefined","payload","JSON","parse","opts","serverFields","distDir","resetFetch","lockfile","nextConfig","dev","buildId","dir","projectPath","bindings","getBindingsSync","require","log","testMode","hasRewrites","fsChecker","rewrites","afterFiles","beforeFiles","fallback","hotReloaderSpan","trace","version","__NEXT_VERSION","stop","mcpServerEnabled","experimental","mcpServer","fileLogger","getFileLogger","initialize","encryptionKey","generateEncryptionKeyBase64","isBuild","clientRouterFilters","clientRouterFilter","supportedBrowsers","getSupportedBrowsers","currentNodeJsVersion","versions","node","rootPath","turbopack","root","outputFileTracingRoot","turbo","createProject","normalizePath","relative","watch","enable","pollIntervalMs","watchOptions","defineEnv","createDefineEnv","isTurbopack","config","fetchCacheKeyPrefix","middlewareMatchers","previewProps","prerenderManifest","preview","browserslistQuery","noMangling","persistentCaching","isFileSystemCacheEnabledForDev","memoryLimit","turbopackMemoryLimit","isShortSession","backgroundLogCompilationEvents","eventTypes","setBundlerFindSourceMapImplementation","bind","onDevServerCleanup","onExit","unlock","entrypointsSubscription","entrypointsSubscribe","currentWrittenEntrypoints","Map","currentEntrypoints","global","app","document","error","middleware","instrumentation","page","currentTopLevelIssues","currentEntryIssues","manifestLoader","TurbopackManifestLoader","changeSubscriptions","serverPathState","readyIds","Set","currentEntriesHandlingResolve","currentEntriesHandling","Promise","resolve","assetMapper","AssetMapper","clearRequireCache","key","writtenEndpoint","force","path","contentHash","serverPaths","endsWith","localKey","set","hasChange","localHash","get","globalHash","__next__clear_chunk_cache__","p","file","clearModuleContext","deleteCache","buildingIds","startBuilding","id","requestUrl","forceRebuild","has","size","consoleStore","setState","loading","trigger","url","add","finishBuilding","delete","hmrEventHappened","hmrHash","clientsWithoutHtmlRequestId","clientsByHtmlRequestId","cacheStatusesByHtmlRequestId","clientStates","WeakMap","sendToClient","client","message","data","type","createBinaryHmrMessageData","stringify","send","sendEnqueuedMessages","issueMap","values","filter","severity","state","clientIssues","messages","clear","turbopackUpdates","HMR_MESSAGE_SENT_TO_BROWSER","TURBOPACK_MESSAGE","sendEnqueuedMessagesDebounce","debounce","sendHmr","sendTurbopackMessage","diagnostics","issues","push","subscribeToChanges","includeIssues","endpoint","createMessage","onError","side","splitEntryKey","changedPromise","changed","change","processIssues","String","e","unsubscribeFromChanges","subscription","return","subscribeToHmrEvents","getEntryKey","hasEntrypointForKey","subscriptions","hmrEvents","next","reloadMessage","RELOAD_PAGE","close","unsubscribeFromHmrEvents","handleEntrypointsSubscription","entrypoints","processTopLevelIssues","printBuildErrors","routes","existingRoutes","keys","newRoutes","addedRoutes","route","removedRoutes","handleEntrypoints","devRewrites","productionRewrites","logErrors","clients","hooks","handleWrittenEndpoint","result","forceDeleteCache","propagateServerField","hotReloader","DEV_PAGES_MANIFEST_UPDATE","devPagesManifest","ADDED_PAGE","REMOVED_PAGE","mkdir","recursive","writeFile","middlewares","getOverlayMiddleware","isSrcDir","getSourceMapMiddleware","getNextErrorFeedbackMiddleware","telemetry","getDevOverlayFontMiddleware","getDisableDevIndicatorMiddleware","getRestartDevServerMiddleware","turbopackProject","devToolsConfigMiddleware","sendUpdateSignal","DEVTOOLS_CONFIG","getMcpMiddleware","pagesDir","appDir","sendHmrMessage","getActiveConnectionCount","getDevServerUrl","__NEXT_PRIVATE_ORIGIN","setStackFrameResolver","request","getOriginalStackFrames","isServer","isEdgeServer","isAppDirectory","frames","versionInfoCached","getVersionInfoCached","getVersionInfo","devtoolsFrontendUrl","nodeOptions","getParsedNodeOptions","nodeDebugType","getNodeDebugType","debugPort","debugInfo","debugInfoList","fetch","then","res","json","activeWebpackConfigs","serverStats","edgeServerStats","run","req","_parsedUrl","startsWith","params","matchNextPageBundleRequest","decodedPagePath","param","decodeURIComponent","denormalizedPagePath","denormalizePagePath","ensurePage","clientOnly","definition","catch","console","calledNext","finished","onHMR","socket","head","onUpgrade","handleUpgrade","htmlRequestId","URL","searchParams","enableCacheComponents","cacheComponents","isLegacyClient","cacheStatus","CACHE_INDICATOR","on","deleteReactDebugChannelForHtmlRequest","addEventListener","parsedData","event","manualTraceChild","spanName","msToNs","startTime","endTime","attributes","updatedModules","isPageHidden","hadRuntimeError","dependencyChain","Log","warn","FAST_REFRESH_RUNTIME_RELOAD","Array","isArray","cleanedModulePath","browserDebugInfoInTerminal","receiveBrowserLogsTurbopack","entries","router","sourceType","handleClientFileLogs","logs","handleErrorStateResponse","requestId","errorState","handlePageMetadataResponse","segmentTrieData","Error","turbopackConnectedMessage","TURBOPACK_CONNECTED","errors","entryIssues","issue","formatIssue","printNonFatalIssue","devIndicatorServerState","disabledUntil","Date","now","versionInfo","devToolsConfig","getDevToolsConfig","syncMessage","SYNC","warnings","hash","debug","devIndicator","connectReactDebugChannelForHtmlRequest","action","sendToLegacyClients","setCacheStatus","status","setReactDebugChannel","debugChannel","connectReactDebugChannel","setReactDebugChannelForHtmlRequest","setHmrServerError","_error","clearHmrServerError","start","getCompilationErrors","appEntryKey","pagesEntryKey","topLevelIssues","thisEntryIssues","formattedIssue","isWellKnownError","invalidate","reloadAfterInvalidation","entrypoint","clearAllModuleContexts","SERVER_COMPONENT_CHANGES","buildFallbackError","inputPage","appPaths","isApp","traceChild","traceAsyncFn","BLOCKED_PAGES","includes","routeDef","findPagePathData","pageExtensions","globalNotFound","isAppPageRouteDefinition","normalizedPage","normalizeAppPath","matchingAppPaths","pathname","handlePagesErrorRoute","setPathsForKey","clientPaths","isInsideAppDir","bundlePath","isEntryMetadataRouteFile","isMetadataRouteFile","filename","normalizedAppPage","normalizedPageToTurbopackStructureRoute","extname","PageNotFoundError","handleRouteType","recordMcpTelemetry","wsClient","terminate","exit","writeManifests","handleProjectUpdates","updateMessage","updateInfoSubscribe","updateType","BUILDING","addToErrorsMap","errorsMap","details","detail","renderStyledStringToErrorAnsi","addErrors","clientErrors","BUILT","time","value","duration","timeMessage","round"],"mappings":";;;;+BAwLsBA;;;eAAAA;;;0BAvLW;sBACO;qBACV;2DAEf;uBAGuB;kCASM;qBASK;6DAC5B;2BACS;qCAKvB;uBAC2B;wBACT;8BACG;8BAIrB;qCAC6B;uBACd;gCAgBf;iCAKA;gCACiC;sCACP;0BAM1B;0BAIA;uCACqC;wCACH;0BACR;wBAEsB;iCACnB;mCACkB;gDACP;wBAUxC;6CACqC;yCACJ;wCACS;4CACH;mCACC;wBACQ;6BAIhD;+BACuB;0CAIvB;8BAMA;wCAIA;kCAC0B;2BACQ;iCACE;8BACL;qCACH;4BACL;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAI9B,MAAMC,WAAW,IAAIC,WAAE,CAACC,MAAM,CAAC;IAAEC,UAAU;AAAK;AAChD,MAAMC,aAAa,CAAC,CAClBC,CAAAA,QAAQC,GAAG,CAACC,cAAc,IAC1BF,QAAQC,GAAG,CAACE,gBAAgB,IAC5BH,QAAQC,GAAG,CAACG,KAAK,AAAD;AAGlB,MAAMC,YAAYC,KAAKC,KAAK,CAACC,OAAOC,gBAAgB,GAAGH,KAAKI,MAAM;AAIlE;;CAEC,GACD,SAASC,wBACPC,WAAmB,EACnBC,SAAiC;IAEjC,IAAI,cAAcA,WAAW;QAC3B,KAAK,MAAMC,WAAWD,UAAUE,QAAQ,CAAE;YACxCJ,wBAAwBC,aAAaE,QAAQE,GAAG;QAClD;IACF,OAAO;QACL,IAAK,IAAIC,IAAI,GAAGA,IAAIJ,UAAUK,OAAO,CAACC,MAAM,EAAEF,IAAK;YACjDJ,UAAUK,OAAO,CAACD,EAAE,GAAGG,IAAAA,kBAAa,EAClCC,IAAAA,UAAI,EACFT,aACAC,UAAUK,OAAO,CAACD,EAAE,CAACK,OAAO,CAAC,+BAA+B,MAE9DC,QAAQ;QACZ;IACF;AACF;AAEA,SAASC,0BACPC,OAAgB,EAChB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