next 15.2.0-canary.61 → 15.2.0-canary.63

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of next might be problematic. Click here for more details.

Files changed (37) hide show
  1. package/dist/bin/next +1 -1
  2. package/dist/build/index.js +2 -2
  3. package/dist/build/swc/index.js +1 -1
  4. package/dist/build/webpack-config.js +2 -2
  5. package/dist/client/app-bootstrap.js +1 -1
  6. package/dist/client/components/react-dev-overlay/server/middleware-turbopack.js +1 -1
  7. package/dist/client/components/react-dev-overlay/server/middleware-turbopack.js.map +1 -1
  8. package/dist/client/index.js +1 -1
  9. package/dist/compiled/next-server/server.runtime.prod.js +2 -2
  10. package/dist/compiled/next-server/server.runtime.prod.js.map +1 -1
  11. package/dist/esm/build/index.js +2 -2
  12. package/dist/esm/build/swc/index.js +1 -1
  13. package/dist/esm/build/webpack-config.js +2 -2
  14. package/dist/esm/client/app-bootstrap.js +1 -1
  15. package/dist/esm/client/components/react-dev-overlay/server/middleware-turbopack.js +1 -1
  16. package/dist/esm/client/components/react-dev-overlay/server/middleware-turbopack.js.map +1 -1
  17. package/dist/esm/client/index.js +1 -1
  18. package/dist/esm/server/base-server.js +2 -2
  19. package/dist/esm/server/base-server.js.map +1 -1
  20. package/dist/esm/server/config.js +1 -1
  21. package/dist/esm/server/dev/hot-reloader-turbopack.js +3 -3
  22. package/dist/esm/server/dev/hot-reloader-turbopack.js.map +1 -1
  23. package/dist/esm/server/dev/hot-reloader-webpack.js +1 -1
  24. package/dist/esm/server/lib/app-info-log.js +1 -1
  25. package/dist/esm/server/lib/start-server.js +1 -1
  26. package/dist/server/base-server.js +2 -2
  27. package/dist/server/base-server.js.map +1 -1
  28. package/dist/server/config.js +1 -1
  29. package/dist/server/dev/hot-reloader-turbopack.js +3 -3
  30. package/dist/server/dev/hot-reloader-turbopack.js.map +1 -1
  31. package/dist/server/dev/hot-reloader-webpack.js +1 -1
  32. package/dist/server/lib/app-info-log.js +1 -1
  33. package/dist/server/lib/start-server.js +1 -1
  34. package/dist/telemetry/anonymous-meta.js +1 -1
  35. package/dist/telemetry/events/session-stopped.js +2 -2
  36. package/dist/telemetry/events/version.js +2 -2
  37. package/package.json +15 -15
@@ -184,7 +184,7 @@ function assignDefaults(dir, userConfig, silent) {
184
184
  configurable: true
185
185
  });
186
186
  }
187
- if (!((_process_env___NEXT_VERSION = "15.2.0-canary.61") == null ? void 0 : _process_env___NEXT_VERSION.includes('canary')) && !process.env.__NEXT_TEST_MODE && !process.env.NEXT_PRIVATE_LOCAL_DEV) {
187
+ if (!((_process_env___NEXT_VERSION = "15.2.0-canary.63") == null ? void 0 : _process_env___NEXT_VERSION.includes('canary')) && !process.env.__NEXT_TEST_MODE && !process.env.NEXT_PRIVATE_LOCAL_DEV) {
188
188
  var _result_experimental7, _result_experimental8, _result_experimental_turbo3, _result_experimental9;
189
189
  // Prevents usage of certain experimental features outside of canary
190
190
  if ((_result_experimental7 = result.experimental) == null ? void 0 : _result_experimental7.ppr) {
@@ -36,7 +36,7 @@ const wsServer = new ws.Server({
36
36
  const isTestMode = !!(process.env.NEXT_TEST_MODE || process.env.__NEXT_TEST_MODE || process.env.DEBUG);
37
37
  const sessionId = Math.floor(Number.MAX_SAFE_INTEGER * Math.random());
38
38
  /**
39
- * Replaces turbopack://[project] with the specified project in the `source` field.
39
+ * Replaces turbopack:///[project] with the specified project in the `source` field.
40
40
  */ function rewriteTurbopackSources(projectRoot, sourceMap) {
41
41
  if ('sections' in sourceMap) {
42
42
  for (const section of sourceMap.sections){
@@ -44,7 +44,7 @@ const sessionId = Math.floor(Number.MAX_SAFE_INTEGER * Math.random());
44
44
  }
45
45
  } else {
46
46
  for(let i = 0; i < sourceMap.sources.length; i++){
47
- sourceMap.sources[i] = pathToFileURL(join(projectRoot, sourceMap.sources[i].replace(/turbopack:\/\/\[project\]/, ''))).toString();
47
+ sourceMap.sources[i] = pathToFileURL(join(projectRoot, sourceMap.sources[i].replace(/turbopack:\/\/\/\[project\]/, ''))).toString();
48
48
  }
49
49
  }
50
50
  }
@@ -80,7 +80,7 @@ export async function createHotReloaderTurbopack(opts, serverFields, distDir, re
80
80
  }
81
81
  const hasRewrites = opts.fsChecker.rewrites.afterFiles.length > 0 || opts.fsChecker.rewrites.beforeFiles.length > 0 || opts.fsChecker.rewrites.fallback.length > 0;
82
82
  const hotReloaderSpan = trace('hot-reloader', undefined, {
83
- version: "15.2.0-canary.61"
83
+ version: "15.2.0-canary.63"
84
84
  });
85
85
  // Ensure the hotReloaderSpan is flushed immediately as it's the parentSpan for all processing
86
86
  // of the current `next dev` invocation.
@@ -1 +1 @@
1
- {"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 } 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 HMR_ACTION_TYPES,\n NextJsHotReloaderInterface,\n ReloadPageAction,\n SyncAction,\n TurbopackConnectedAction,\n} from './hot-reloader-types'\nimport { HMR_ACTIONS_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 } from '../../build/swc'\nimport * as Log from '../../build/output/log'\nimport {\n getVersionInfo,\n matchNextPageBundleRequest,\n} from './hot-reloader-webpack'\nimport { BLOCKED_PAGES } from '../../shared/lib/constants'\nimport {\n getOverlayMiddleware,\n getSourceMapMiddleware,\n} from '../../client/components/react-dev-overlay/server/middleware-turbopack'\nimport { PageNotFoundError } from '../../shared/lib/utils'\nimport { debounce } from '../utils'\nimport { deleteAppClientCache, 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 { FAST_REFRESH_RUNTIME_RELOAD } 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 { getNodeDebugType } from '../lib/utils'\nimport { isMetadataRouteFile } from '../../lib/metadata/is-metadata-route'\nimport {\n setBundlerFindSourceMapImplementation,\n type ModernSourceMapPayload,\n} from '../patch-error-inspect'\nimport { getNextErrorFeedbackMiddleware } from '../../client/components/react-dev-overlay/server/get-next-error-feedback-middleware'\nimport {\n formatIssue,\n getTurbopackJsConfig,\n isPersistentCachingEnabled,\n isWellKnownError,\n processIssues,\n renderStyledStringToErrorAnsi,\n type EntryIssuesMap,\n type TopLevelIssuesMap,\n} from '../../shared/lib/turbopack/utils'\n// import { getSupportedBrowsers } from '../../build/utils'\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\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,\n serverFields: ServerFields,\n distDir: string,\n resetFetch: () => void\n): Promise<NextJsHotReloaderInterface> {\n const dev = true\n const buildId = 'development'\n const { nextConfig, dir } = opts\n\n const { loadBindings } =\n require('../../build/swc') as typeof import('../../build/swc')\n\n let bindings = await loadBindings()\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 (process.env.TURBOPACK && isTestMode) {\n require('console').log('Creating turbopack project', {\n dir,\n testMode: isTestMode,\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 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 persistent caching to work\n }\n\n // const supportedBrowsers = await getSupportedBrowsers(dir, dev)\n const supportedBrowsers = [\n 'last 1 Chrome versions, last 1 Firefox versions, last 1 Safari versions, last 1 Edge versions',\n ]\n\n const project = await bindings.turbo.createProject(\n {\n projectPath: dir,\n rootPath:\n opts.nextConfig.experimental.turbo?.root ||\n opts.nextConfig.outputFileTracingRoot ||\n dir,\n distDir,\n nextConfig: opts.nextConfig,\n jsConfig: await getTurbopackJsConfig(dir, 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 fetchCacheKeyPrefix: opts.nextConfig.experimental.fetchCacheKeyPrefix,\n hasRewrites,\n // TODO: Implement\n middlewareMatchers: undefined,\n }),\n buildId,\n encryptionKey,\n previewProps: opts.fsChecker.prerenderManifest.preview,\n browserslistQuery: supportedBrowsers.join(', '),\n noMangling: false,\n },\n {\n persistentCaching: isPersistentCachingEnabled(opts.nextConfig),\n memoryLimit: opts.nextConfig.experimental.turbo?.memoryLimit,\n }\n )\n setBundlerFindSourceMapImplementation(\n getSourceMapFromTurbopack.bind(null, project, dir)\n )\n opts.onDevServerCleanup?.(async () => {\n setBundlerFindSourceMapImplementation(() => undefined)\n await project.onExit()\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 ): void {\n if (force) {\n for (const { path, contentHash } of writtenEndpoint.serverPaths) {\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(key, contentHash)\n serverPathState.set(path, contentHash)\n } else {\n if (!localHash) {\n serverPathState.set(key, contentHash)\n }\n if (!globalHash) {\n serverPathState.set(path, contentHash)\n }\n }\n }\n\n if (!hasChange) {\n return\n }\n }\n\n resetFetch()\n\n const hasAppPaths = writtenEndpoint.serverPaths.some(({ path: p }) =>\n p.startsWith('server/app')\n )\n\n if (hasAppPaths) {\n deleteAppClientCache()\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\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 clients = new Set<ws>()\n const clientStates = new WeakMap<ws, ClientState>()\n\n function sendToClient(client: ws, payload: HMR_ACTION_TYPES) {\n client.send(JSON.stringify(payload))\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 clients) {\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 payload of state.hmrPayloads.values()) {\n sendToClient(client, payload)\n }\n state.hmrPayloads.clear()\n\n if (state.turbopackUpdates.length > 0) {\n sendToClient(client, {\n action: HMR_ACTIONS_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, payload: HMR_ACTION_TYPES) => {\n for (const client of clients) {\n clientStates.get(client)?.hmrPayloads.set(id, payload)\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 clients) {\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 makePayload: (\n change: TurbopackResult,\n hash: string\n ) => Promise<HMR_ACTION_TYPES> | HMR_ACTION_TYPES | void,\n onError?: (\n error: Error\n ) => Promise<HMR_ACTION_TYPES> | HMR_ACTION_TYPES | 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 payload = await makePayload(change, String(++hmrHash))\n if (payload) {\n sendHmr(key, payload)\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 reloadAction: ReloadPageAction = {\n action: HMR_ACTIONS_SENT_TO_BROWSER.RELOAD_PAGE,\n data: `error in HMR event subscription for ${id}: ${e}`,\n }\n sendToClient(client, reloadAction)\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 processTopLevelIssues(currentTopLevelIssues, entrypoints)\n\n await handleEntrypoints({\n entrypoints,\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 clientStates,\n serverFields,\n\n hooks: {\n handleWrittenEndpoint: (id, result) => {\n currentWrittenEntrypoints.set(id, result)\n clearRequireCache(id, result)\n },\n propagateServerField: propagateServerField.bind(null, opts),\n sendHmr,\n startBuilding,\n subscribeToChanges,\n unsubscribeFromChanges,\n unsubscribeFromHmrEvents,\n },\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(project),\n getSourceMapMiddleware(project),\n getNextErrorFeedbackMiddleware(opts.telemetry),\n ]\n\n const versionInfoPromise = getVersionInfo()\n\n let devtoolsFrontendUrl: string | undefined\n const nodeDebugType = getNodeDebugType()\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 onUpgrade(client)\n const clientIssues: EntryIssuesMap = new Map()\n const subscriptions: Map<string, AsyncIterator<any>> = new Map()\n\n clients.add(client)\n clientStates.set(client, {\n clientIssues,\n hmrPayloads: 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 clients.delete(client)\n })\n\n client.addEventListener('message', ({ 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 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\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 turbopackConnected: TurbopackConnectedAction = {\n action: HMR_ACTIONS_SENT_TO_BROWSER.TURBOPACK_CONNECTED,\n data: { sessionId },\n }\n sendToClient(client, turbopackConnected)\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 ;(async function () {\n const versionInfo = await versionInfoPromise\n\n const sync: SyncAction = {\n action: HMR_ACTIONS_SENT_TO_BROWSER.SYNC,\n errors,\n warnings: [],\n hash: '',\n versionInfo,\n debug: {\n devtoolsFrontendUrl,\n },\n }\n\n sendToClient(client, sync)\n })()\n })\n },\n\n send(action) {\n const payload = JSON.stringify(action)\n for (const client of clients) {\n client.send(payload)\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 action: HMR_ACTIONS_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 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 dir,\n inputPage,\n nextConfig.pageExtensions,\n opts.pagesDir,\n opts.appDir\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) => {\n clearRequireCache(id, result)\n currentWrittenEntrypoints.set(id, result)\n assetMapper.setPathsForKey(id, result.clientPaths)\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 === '/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) => {\n currentWrittenEntrypoints.set(id, result)\n clearRequireCache(id, result)\n assetMapper.setPathsForKey(id, result.clientPaths)\n },\n },\n })\n } finally {\n finishBuilding()\n }\n })\n },\n close() {\n for (const wsClient of clients) {\n // it's okay to not cleanly close these websocket connections, this is dev\n wsClient.terminate()\n }\n clients.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({ action: HMR_ACTIONS_SENT_TO_BROWSER.BUILDING })\n break\n }\n case 'end': {\n sendEnqueuedMessages()\n\n function addErrors(\n errorsMap: Map<string, CompilationError>,\n issues: EntryIssuesMap\n ) {\n for (const issueMap of issues.values()) {\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\n const errors = new Map<string, CompilationError>()\n addErrors(errors, currentEntryIssues)\n\n for (const client of clients) {\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 action: HMR_ACTIONS_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":["mkdir","writeFile","join","extname","pathToFileURL","ws","store","consoleStore","HMR_ACTIONS_SENT_TO_BROWSER","createDefineEnv","Log","getVersionInfo","matchNextPageBundleRequest","BLOCKED_PAGES","getOverlayMiddleware","getSourceMapMiddleware","PageNotFoundError","debounce","deleteAppClientCache","deleteCache","clearAllModuleContexts","clearModuleContext","denormalizePagePath","trace","AssetMapper","handleEntrypoints","handlePagesErrorRoute","handleRouteType","hasEntrypointForKey","msToNs","processTopLevelIssues","printNonFatalIssue","normalizedPageToTurbopackStructureRoute","propagateServerField","TurbopackManifestLoader","findPagePathData","getEntryKey","splitEntryKey","FAST_REFRESH_RUNTIME_RELOAD","generateEncryptionKeyBase64","isAppPageRouteDefinition","normalizeAppPath","getNodeDebugType","isMetadataRouteFile","setBundlerFindSourceMapImplementation","getNextErrorFeedbackMiddleware","formatIssue","getTurbopackJsConfig","isPersistentCachingEnabled","isWellKnownError","processIssues","renderStyledStringToErrorAnsi","wsServer","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","replace","toString","getSourceMapFromTurbopack","project","sourceURL","sourceMapJson","getSourceMapSync","err","undefined","payload","JSON","parse","createHotReloaderTurbopack","opts","serverFields","distDir","resetFetch","nextConfig","dev","buildId","dir","loadBindings","require","bindings","TURBOPACK","log","testMode","hasRewrites","fsChecker","rewrites","afterFiles","beforeFiles","fallback","hotReloaderSpan","version","__NEXT_VERSION","stop","encryptionKey","isBuild","clientRouterFilters","experimental","clientRouterFilter","supportedBrowsers","turbo","createProject","projectPath","rootPath","root","outputFileTracingRoot","jsConfig","watch","enable","pollIntervalMs","watchOptions","defineEnv","isTurbopack","config","fetchCacheKeyPrefix","middlewareMatchers","previewProps","prerenderManifest","preview","browserslistQuery","noMangling","persistentCaching","memoryLimit","bind","onDevServerCleanup","onExit","entrypointsSubscription","entrypointsSubscribe","currentWrittenEntrypoints","Map","currentEntrypoints","global","app","document","error","middleware","instrumentation","page","currentTopLevelIssues","currentEntryIssues","manifestLoader","changeSubscriptions","serverPathState","readyIds","Set","currentEntriesHandlingResolve","currentEntriesHandling","Promise","resolve","assetMapper","clearRequireCache","key","writtenEndpoint","force","path","contentHash","serverPaths","set","hasChange","endsWith","localKey","localHash","get","globalHash","hasAppPaths","some","p","startsWith","file","buildingIds","startBuilding","id","requestUrl","forceRebuild","has","size","setState","loading","trigger","url","add","finishBuilding","delete","hmrEventHappened","hmrHash","clients","clientStates","WeakMap","sendToClient","client","send","stringify","sendEnqueuedMessages","issueMap","values","filter","severity","state","clientIssues","hmrPayloads","clear","turbopackUpdates","action","TURBOPACK_MESSAGE","data","sendEnqueuedMessagesDebounce","sendHmr","sendTurbopackMessage","diagnostics","issues","push","subscribeToChanges","includeIssues","endpoint","makePayload","onError","side","changedPromise","changed","change","String","e","unsubscribeFromChanges","subscription","return","subscribeToHmrEvents","subscriptions","hmrEvents","next","type","reloadAction","RELOAD_PAGE","close","unsubscribeFromHmrEvents","handleEntrypointsSubscription","entrypoints","devRewrites","productionRewrites","logErrors","hooks","handleWrittenEndpoint","result","recursive","middlewares","telemetry","versionInfoPromise","devtoolsFrontendUrl","nodeDebugType","debugPort","debugInfo","debugInfoList","fetch","then","res","json","hotReloader","turbopackProject","activeWebpackConfigs","serverStats","edgeServerStats","run","req","_parsedUrl","params","decodedPagePath","param","decodeURIComponent","denormalizedPagePath","ensurePage","clientOnly","definition","catch","console","calledNext","finished","onHMR","socket","head","onUpgrade","handleUpgrade","on","addEventListener","parsedData","event","manualTraceChild","spanName","startTime","endTime","attributes","updatedModules","isPageHidden","hadRuntimeError","dependencyChain","warn","Array","isArray","cleanedModulePath","Error","turbopackConnected","TURBOPACK_CONNECTED","errors","entryIssues","issue","message","versionInfo","sync","SYNC","warnings","hash","debug","setHmrServerError","_error","clearHmrServerError","start","getCompilationErrors","appEntryKey","pagesEntryKey","topLevelIssues","thisEntryIssues","formattedIssue","invalidate","reloadAfterInvalidation","entrypoint","SERVER_COMPONENT_CHANGES","buildFallbackError","inputPage","appPaths","isApp","traceChild","traceAsyncFn","includes","routeDef","pageExtensions","pagesDir","appDir","normalizedPage","matchingAppPaths","pathname","setPathsForKey","clientPaths","isInsideAppDir","bundlePath","isEntryMetadataRouteFile","filename","normalizedAppPage","route","wsClient","terminate","exit","writeManifests","handleProjectUpdates","updateMessage","updateInfoSubscribe","updateType","BUILDING","addErrors","errorsMap","details","detail","clientErrors","BUILT","time","value","duration","timeMessage","round"],"mappings":"AACA,SAASA,KAAK,EAAEC,SAAS,QAAQ,cAAa;AAC9C,SAASC,IAAI,EAAEC,OAAO,QAAQ,OAAM;AACpC,SAASC,aAAa,QAAQ,MAAK;AAEnC,OAAOC,QAAQ,wBAAuB;AAGtC,SAASC,SAASC,YAAY,QAAQ,2BAA0B;AAShE,SAASC,2BAA2B,QAAQ,uBAAsB;AASlE,SAASC,eAAe,QAAQ,kBAAiB;AACjD,YAAYC,SAAS,yBAAwB;AAC7C,SACEC,cAAc,EACdC,0BAA0B,QACrB,yBAAwB;AAC/B,SAASC,aAAa,QAAQ,6BAA4B;AAC1D,SACEC,oBAAoB,EACpBC,sBAAsB,QACjB,wEAAuE;AAC9E,SAASC,iBAAiB,QAAQ,yBAAwB;AAC1D,SAASC,QAAQ,QAAQ,WAAU;AACnC,SAASC,oBAAoB,EAAEC,WAAW,QAAQ,kBAAiB;AACnE,SACEC,sBAAsB,EACtBC,kBAAkB,QACb,uBAAsB;AAC7B,SAASC,mBAAmB,QAAQ,mDAAkD;AACtF,SAASC,KAAK,QAAQ,cAAa;AACnC,SACEC,WAAW,EAGXC,iBAAiB,EACjBC,qBAAqB,EACrBC,eAAe,EACfC,mBAAmB,EACnBC,MAAM,EAINC,qBAAqB,EACrBC,kBAAkB,EAClBC,uCAAuC,QAClC,oBAAmB;AAC1B,SACEC,oBAAoB,QAGf,wCAAuC;AAC9C,SAASC,uBAAuB,QAAQ,6CAA4C;AACpF,SAASC,gBAAgB,QAAQ,4BAA2B;AAE5D,SAEEC,WAAW,EACXC,aAAa,QACR,uCAAsC;AAC7C,SAASC,2BAA2B,QAAQ,aAAY;AACxD,SAASC,2BAA2B,QAAQ,wCAAuC;AACnF,SAASC,wBAAwB,QAAQ,iD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AKkU,KAAK,CAACJ,OAAO,OAAO,GAAG,CAAC,CAAC,GAAG,GAAGA,KAAK,EAAE,CAAC;4BAC/DlX,IAAIoS,KAAK,CAAC,CAAC,YAAY,EAAEiF,aAAa;4BACtCrL,mBAAmB;wBACrB;wBACA;oBACF;gBACA;YACF;QACF;IACF;IAEAuK,uBAAuB/E,KAAK,CAAC,CAAC/M;QAC5BgN,QAAQ1I,KAAK,CAACtE;QACd3B,QAAQuT,IAAI,CAAC;IACf;IAEA,OAAO7F;AACT"}
1
+ {"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 } 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 HMR_ACTION_TYPES,\n NextJsHotReloaderInterface,\n ReloadPageAction,\n SyncAction,\n TurbopackConnectedAction,\n} from './hot-reloader-types'\nimport { HMR_ACTIONS_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 } from '../../build/swc'\nimport * as Log from '../../build/output/log'\nimport {\n getVersionInfo,\n matchNextPageBundleRequest,\n} from './hot-reloader-webpack'\nimport { BLOCKED_PAGES } from '../../shared/lib/constants'\nimport {\n getOverlayMiddleware,\n getSourceMapMiddleware,\n} from '../../client/components/react-dev-overlay/server/middleware-turbopack'\nimport { PageNotFoundError } from '../../shared/lib/utils'\nimport { debounce } from '../utils'\nimport { deleteAppClientCache, 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 { FAST_REFRESH_RUNTIME_RELOAD } 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 { getNodeDebugType } from '../lib/utils'\nimport { isMetadataRouteFile } from '../../lib/metadata/is-metadata-route'\nimport {\n setBundlerFindSourceMapImplementation,\n type ModernSourceMapPayload,\n} from '../patch-error-inspect'\nimport { getNextErrorFeedbackMiddleware } from '../../client/components/react-dev-overlay/server/get-next-error-feedback-middleware'\nimport {\n formatIssue,\n getTurbopackJsConfig,\n isPersistentCachingEnabled,\n isWellKnownError,\n processIssues,\n renderStyledStringToErrorAnsi,\n type EntryIssuesMap,\n type TopLevelIssuesMap,\n} from '../../shared/lib/turbopack/utils'\n// import { getSupportedBrowsers } from '../../build/utils'\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\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,\n serverFields: ServerFields,\n distDir: string,\n resetFetch: () => void\n): Promise<NextJsHotReloaderInterface> {\n const dev = true\n const buildId = 'development'\n const { nextConfig, dir } = opts\n\n const { loadBindings } =\n require('../../build/swc') as typeof import('../../build/swc')\n\n let bindings = await loadBindings()\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 (process.env.TURBOPACK && isTestMode) {\n require('console').log('Creating turbopack project', {\n dir,\n testMode: isTestMode,\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 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 persistent caching to work\n }\n\n // const supportedBrowsers = await getSupportedBrowsers(dir, dev)\n const supportedBrowsers = [\n 'last 1 Chrome versions, last 1 Firefox versions, last 1 Safari versions, last 1 Edge versions',\n ]\n\n const project = await bindings.turbo.createProject(\n {\n projectPath: dir,\n rootPath:\n opts.nextConfig.experimental.turbo?.root ||\n opts.nextConfig.outputFileTracingRoot ||\n dir,\n distDir,\n nextConfig: opts.nextConfig,\n jsConfig: await getTurbopackJsConfig(dir, 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 fetchCacheKeyPrefix: opts.nextConfig.experimental.fetchCacheKeyPrefix,\n hasRewrites,\n // TODO: Implement\n middlewareMatchers: undefined,\n }),\n buildId,\n encryptionKey,\n previewProps: opts.fsChecker.prerenderManifest.preview,\n browserslistQuery: supportedBrowsers.join(', '),\n noMangling: false,\n },\n {\n persistentCaching: isPersistentCachingEnabled(opts.nextConfig),\n memoryLimit: opts.nextConfig.experimental.turbo?.memoryLimit,\n }\n )\n setBundlerFindSourceMapImplementation(\n getSourceMapFromTurbopack.bind(null, project, dir)\n )\n opts.onDevServerCleanup?.(async () => {\n setBundlerFindSourceMapImplementation(() => undefined)\n await project.onExit()\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 ): void {\n if (force) {\n for (const { path, contentHash } of writtenEndpoint.serverPaths) {\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(key, contentHash)\n serverPathState.set(path, contentHash)\n } else {\n if (!localHash) {\n serverPathState.set(key, contentHash)\n }\n if (!globalHash) {\n serverPathState.set(path, contentHash)\n }\n }\n }\n\n if (!hasChange) {\n return\n }\n }\n\n resetFetch()\n\n const hasAppPaths = writtenEndpoint.serverPaths.some(({ path: p }) =>\n p.startsWith('server/app')\n )\n\n if (hasAppPaths) {\n deleteAppClientCache()\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\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 clients = new Set<ws>()\n const clientStates = new WeakMap<ws, ClientState>()\n\n function sendToClient(client: ws, payload: HMR_ACTION_TYPES) {\n client.send(JSON.stringify(payload))\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 clients) {\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 payload of state.hmrPayloads.values()) {\n sendToClient(client, payload)\n }\n state.hmrPayloads.clear()\n\n if (state.turbopackUpdates.length > 0) {\n sendToClient(client, {\n action: HMR_ACTIONS_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, payload: HMR_ACTION_TYPES) => {\n for (const client of clients) {\n clientStates.get(client)?.hmrPayloads.set(id, payload)\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 clients) {\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 makePayload: (\n change: TurbopackResult,\n hash: string\n ) => Promise<HMR_ACTION_TYPES> | HMR_ACTION_TYPES | void,\n onError?: (\n error: Error\n ) => Promise<HMR_ACTION_TYPES> | HMR_ACTION_TYPES | 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 payload = await makePayload(change, String(++hmrHash))\n if (payload) {\n sendHmr(key, payload)\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 reloadAction: ReloadPageAction = {\n action: HMR_ACTIONS_SENT_TO_BROWSER.RELOAD_PAGE,\n data: `error in HMR event subscription for ${id}: ${e}`,\n }\n sendToClient(client, reloadAction)\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 processTopLevelIssues(currentTopLevelIssues, entrypoints)\n\n await handleEntrypoints({\n entrypoints,\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 clientStates,\n serverFields,\n\n hooks: {\n handleWrittenEndpoint: (id, result) => {\n currentWrittenEntrypoints.set(id, result)\n clearRequireCache(id, result)\n },\n propagateServerField: propagateServerField.bind(null, opts),\n sendHmr,\n startBuilding,\n subscribeToChanges,\n unsubscribeFromChanges,\n unsubscribeFromHmrEvents,\n },\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(project),\n getSourceMapMiddleware(project),\n getNextErrorFeedbackMiddleware(opts.telemetry),\n ]\n\n const versionInfoPromise = getVersionInfo()\n\n let devtoolsFrontendUrl: string | undefined\n const nodeDebugType = getNodeDebugType()\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 onUpgrade(client)\n const clientIssues: EntryIssuesMap = new Map()\n const subscriptions: Map<string, AsyncIterator<any>> = new Map()\n\n clients.add(client)\n clientStates.set(client, {\n clientIssues,\n hmrPayloads: 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 clients.delete(client)\n })\n\n client.addEventListener('message', ({ 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 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\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 turbopackConnected: TurbopackConnectedAction = {\n action: HMR_ACTIONS_SENT_TO_BROWSER.TURBOPACK_CONNECTED,\n data: { sessionId },\n }\n sendToClient(client, turbopackConnected)\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 ;(async function () {\n const versionInfo = await versionInfoPromise\n\n const sync: SyncAction = {\n action: HMR_ACTIONS_SENT_TO_BROWSER.SYNC,\n errors,\n warnings: [],\n hash: '',\n versionInfo,\n debug: {\n devtoolsFrontendUrl,\n },\n }\n\n sendToClient(client, sync)\n })()\n })\n },\n\n send(action) {\n const payload = JSON.stringify(action)\n for (const client of clients) {\n client.send(payload)\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 action: HMR_ACTIONS_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 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 dir,\n inputPage,\n nextConfig.pageExtensions,\n opts.pagesDir,\n opts.appDir\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) => {\n clearRequireCache(id, result)\n currentWrittenEntrypoints.set(id, result)\n assetMapper.setPathsForKey(id, result.clientPaths)\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 === '/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) => {\n currentWrittenEntrypoints.set(id, result)\n clearRequireCache(id, result)\n assetMapper.setPathsForKey(id, result.clientPaths)\n },\n },\n })\n } finally {\n finishBuilding()\n }\n })\n },\n close() {\n for (const wsClient of clients) {\n // it's okay to not cleanly close these websocket connections, this is dev\n wsClient.terminate()\n }\n clients.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({ action: HMR_ACTIONS_SENT_TO_BROWSER.BUILDING })\n break\n }\n case 'end': {\n sendEnqueuedMessages()\n\n function addErrors(\n errorsMap: Map<string, CompilationError>,\n issues: EntryIssuesMap\n ) {\n for (const issueMap of issues.values()) {\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\n const errors = new Map<string, CompilationError>()\n addErrors(errors, currentEntryIssues)\n\n for (const client of clients) {\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 action: HMR_ACTIONS_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":["mkdir","writeFile","join","extname","pathToFileURL","ws","store","consoleStore","HMR_ACTIONS_SENT_TO_BROWSER","createDefineEnv","Log","getVersionInfo","matchNextPageBundleRequest","BLOCKED_PAGES","getOverlayMiddleware","getSourceMapMiddleware","PageNotFoundError","debounce","deleteAppClientCache","deleteCache","clearAllModuleContexts","clearModuleContext","denormalizePagePath","trace","AssetMapper","handleEntrypoints","handlePagesErrorRoute","handleRouteType","hasEntrypointForKey","msToNs","processTopLevelIssues","printNonFatalIssue","normalizedPageToTurbopackStructureRoute","propagateServerField","TurbopackManifestLoader","findPagePathData","getEntryKey","splitEntryKey","FAST_REFRESH_RUNTIME_RELOAD","generateEncryptionKeyBase64","isAppPageRouteDefinition","normalizeAppPath","getNodeDebugType","isMetadataRouteFile","setBundlerFindSourceMapImplementation","getNextErrorFeedbackMiddleware","formatIssue","getTurbopackJsConfig","isPersistentCachingEnabled","isWellKnownError","processIssues","renderStyledStringToErrorAnsi","wsServer","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","replace","toString","getSourceMapFromTurbopack","project","sourceURL","sourceMapJson","getSourceMapSync","err","undefined","payload","JSON","parse","createHotReloaderTurbopack","opts","serverFields","distDir","resetFetch","nextConfig","dev","buildId","dir","loadBindings","require","bindings","TURBOPACK","log","testMode","hasRewrites","fsChecker","rewrites","afterFiles","beforeFiles","fallback","hotReloaderSpan","version","__NEXT_VERSION","stop","encryptionKey","isBuild","clientRouterFilters","experimental","clientRouterFilter","supportedBrowsers","turbo","createProject","projectPath","rootPath","root","outputFileTracingRoot","jsConfig","watch","enable","pollIntervalMs","watchOptions","defineEnv","isTurbopack","config","fetchCacheKeyPrefix","middlewareMatchers","previewProps","prerenderManifest","preview","browserslistQuery","noMangling","persistentCaching","memoryLimit","bind","onDevServerCleanup","onExit","entrypointsSubscription","entrypointsSubscribe","currentWrittenEntrypoints","Map","currentEntrypoints","global","app","document","error","middleware","instrumentation","page","currentTopLevelIssues","currentEntryIssues","manifestLoader","changeSubscriptions","serverPathState","readyIds","Set","currentEntriesHandlingResolve","currentEntriesHandling","Promise","resolve","assetMapper","clearRequireCache","key","writtenEndpoint","force","path","contentHash","serverPaths","set","hasChange","endsWith","localKey","localHash","get","globalHash","hasAppPaths","some","p","startsWith","file","buildingIds","startBuilding","id","requestUrl","forceRebuild","has","size","setState","loading","trigger","url","add","finishBuilding","delete","hmrEventHappened","hmrHash","clients","clientStates","WeakMap","sendToClient","client","send","stringify","sendEnqueuedMessages","issueMap","values","filter","severity","state","clientIssues","hmrPayloads","clear","turbopackUpdates","action","TURBOPACK_MESSAGE","data","sendEnqueuedMessagesDebounce","sendHmr","sendTurbopackMessage","diagnostics","issues","push","subscribeToChanges","includeIssues","endpoint","makePayload","onError","side","changedPromise","changed","change","String","e","unsubscribeFromChanges","subscription","return","subscribeToHmrEvents","subscriptions","hmrEvents","next","type","reloadAction","RELOAD_PAGE","close","unsubscribeFromHmrEvents","handleEntrypointsSubscription","entrypoints","devRewrites","productionRewrites","logErrors","hooks","handleWrittenEndpoint","result","recursive","middlewares","telemetry","versionInfoPromise","devtoolsFrontendUrl","nodeDebugType","debugPort","debugInfo","debugInfoList","fetch","then","res","json","hotReloader","turbopackProject","activeWebpackConfigs","serverStats","edgeServerStats","run","req","_parsedUrl","params","decodedPagePath","param","decodeURIComponent","denormalizedPagePath","ensurePage","clientOnly","definition","catch","console","calledNext","finished","onHMR","socket","head","onUpgrade","handleUpgrade","on","addEventListener","parsedData","event","manualTraceChild","spanName","startTime","endTime","attributes","updatedModules","isPageHidden","hadRuntimeError","dependencyChain","warn","Array","isArray","cleanedModulePath","Error","turbopackConnected","TURBOPACK_CONNECTED","errors","entryIssues","issue","message","versionInfo","sync","SYNC","warnings","hash","debug","setHmrServerError","_error","clearHmrServerError","start","getCompilationErrors","appEntryKey","pagesEntryKey","topLevelIssues","thisEntryIssues","formattedIssue","invalidate","reloadAfterInvalidation","entrypoint","SERVER_COMPONENT_CHANGES","buildFallbackError","inputPage","appPaths","isApp","traceChild","traceAsyncFn","includes","routeDef","pageExtensions","pagesDir","appDir","normalizedPage","matchingAppPaths","pathname","setPathsForKey","clientPaths","isInsideAppDir","bundlePath","isEntryMetadataRouteFile","filename","normalizedAppPage","route","wsClient","terminate","exit","writeManifests","handleProjectUpdates","updateMessage","updateInfoSubscribe","updateType","BUILDING","addErrors","errorsMap","details","detail","clientErrors","BUILT","time","value","duration","timeMessage","round"],"mappings":"AACA,SAASA,KAAK,EAAEC,SAAS,QAAQ,cAAa;AAC9C,SAASC,IAAI,EAAEC,OAAO,QAAQ,OAAM;AACpC,SAASC,aAAa,QAAQ,MAAK;AAEnC,OAAOC,QAAQ,wBAAuB;AAGtC,SAASC,SAASC,YAAY,QAAQ,2BAA0B;AAShE,SAASC,2BAA2B,QAAQ,uBAAsB;AASlE,SAASC,eAAe,QAAQ,kBAAiB;AACjD,YAAYC,SAAS,yBAAwB;AAC7C,SACEC,cAAc,EACdC,0BAA0B,QACrB,yBAAwB;AAC/B,SAASC,aAAa,QAAQ,6BAA4B;AAC1D,SACEC,oBAAoB,EACpBC,sBAAsB,QACjB,wEAAuE;AAC9E,SAASC,iBAAiB,QAAQ,yBAAwB;AAC1D,SAASC,QAAQ,QAAQ,WAAU;AACnC,SAASC,oBAAoB,EAAEC,WAAW,QAAQ,kBAAiB;AACnE,SACEC,sBAAsB,EACtBC,kBAAkB,QACb,uBAAsB;AAC7B,SAASC,mBAAmB,QAAQ,mDAAkD;AACtF,SAASC,KAAK,QAAQ,cAAa;AACnC,SACEC,WAAW,EAGXC,iBAAiB,EACjBC,qBAAqB,EACrBC,eAAe,EACfC,mBAAmB,EACnBC,MAAM,EAINC,qBAAqB,EACrBC,kBAAkB,EAClBC,uCAAuC,QAClC,oBAAmB;AAC1B,SACEC,oBAAoB,QAGf,wCAAuC;AAC9C,SAASC,uBAAuB,QAAQ,6CAA4C;AACpF,SAASC,gBAAgB,QAAQ,4BAA2B;AAE5D,SAEEC,WAAW,EACXC,aAAa,QACR,uCAAsC;AAC7C,SAASC,2BAA2B,QAAQ,aAAY;AACxD,SAASC,2BAA2B,QAAQ,wCAAuC;AACnF,SAASC,wBAAwB,QAAQ,iDAAgD;AACzF,SAASC,gBAAgB,QAAQ,0CAAyC;AAC1E,SAASC,gBAAgB,QAAQ,eAAc;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AC;4BAC/DlX,IAAIoS,KAAK,CAAC,CAAC,YAAY,EAAEiF,aAAa;4BACtCrL,mBAAmB;wBACrB;wBACA;oBACF;gBACA;YACF;QACF;IACF;IAEAuK,uBAAuB/E,KAAK,CAAC,CAAC/M;QAC5BgN,QAAQ1I,KAAK,CAACtE;QACd3B,QAAQuT,IAAI,CAAC;IACf;IAEA,OAAO7F;AACT"}
@@ -178,7 +178,7 @@ export default class HotReloaderWebpack {
178
178
  this.previewProps = previewProps;
179
179
  this.rewrites = rewrites;
180
180
  this.hotReloaderSpan = trace('hot-reloader', undefined, {
181
- version: "15.2.0-canary.61"
181
+ version: "15.2.0-canary.63"
182
182
  });
183
183
  // Ensure the hotReloaderSpan is flushed immediately as it's the parentSpan for all processing
184
184
  // of the current `next dev` invocation.
@@ -4,7 +4,7 @@ import { bold, purple } from '../../lib/picocolors';
4
4
  import { PHASE_DEVELOPMENT_SERVER, PHASE_PRODUCTION_BUILD } from '../../shared/lib/constants';
5
5
  import loadConfig, { getConfiguredExperimentalFeatures } from '../config';
6
6
  export function logStartInfo({ networkUrl, appUrl, envInfo, experimentalFeatures, maxExperimentalFeatures = Infinity }) {
7
- Log.bootstrap(`${bold(purple(`${Log.prefixes.ready} Next.js ${"15.2.0-canary.61"}`))}${process.env.TURBOPACK ? ' (Turbopack)' : ''}`);
7
+ Log.bootstrap(`${bold(purple(`${Log.prefixes.ready} Next.js ${"15.2.0-canary.63"}`))}${process.env.TURBOPACK ? ' (Turbopack)' : ''}`);
8
8
  if (appUrl) {
9
9
  Log.bootstrap(`- Local: ${appUrl}`);
10
10
  }
@@ -43,7 +43,7 @@ export async function getRequestHandlers({ dir, port, isDev, onDevServerCleanup,
43
43
  export async function startServer(serverOptions) {
44
44
  const { dir, isDev, hostname, minimalMode, allowRetry, keepAliveTimeout, selfSignedCertificate } = serverOptions;
45
45
  let { port } = serverOptions;
46
- process.title = `next-server (v${"15.2.0-canary.61"})`;
46
+ process.title = `next-server (v${"15.2.0-canary.63"})`;
47
47
  let handlersReady = ()=>{};
48
48
  let handlersError = ()=>{};
49
49
  let handlersPromise = new Promise((resolve, reject)=>{
@@ -1238,7 +1238,7 @@ class Server {
1238
1238
  /**
1239
1239
  * If the route being rendered is an app page, and the ppr feature has been
1240
1240
  * enabled, then the given route _could_ support PPR.
1241
- */ const couldSupportPPR = this.isAppPPREnabled && typeof routeModule !== 'undefined' && (0, _checks.isAppPageRouteModule)(routeModule) && !isHtmlBot;
1241
+ */ const couldSupportPPR = this.isAppPPREnabled && typeof routeModule !== 'undefined' && (0, _checks.isAppPageRouteModule)(routeModule);
1242
1242
  // When enabled, this will allow the use of the `?__nextppronly` query to
1243
1243
  // enable debugging of the static shell.
1244
1244
  const hasDebugStaticShellQuery = process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING === '1' && typeof query.__nextppronly !== 'undefined' && couldSupportPPR;
@@ -1963,7 +1963,7 @@ class Server {
1963
1963
  }
1964
1964
  });
1965
1965
  }
1966
- const didPostpone = ((_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind) === _responsecache.CachedRouteKind.APP_PAGE && typeof cacheEntry.value.postponed === 'string' && !isHtmlBot;
1966
+ const didPostpone = ((_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind) === _responsecache.CachedRouteKind.APP_PAGE && typeof cacheEntry.value.postponed === 'string';
1967
1967
  if (isSSG && // We don't want to send a cache header for requests that contain dynamic
1968
1968
  // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC
1969
1969
  // request, then we should set the cache header.