{"version":3,"sources":["../../../src/server/dev/next-dev-server.ts"],"sourcesContent":["import type { FindComponentsResult, NodeRequestHandler } from '../next-server'\nimport type { LoadComponentsReturnType } from '../load-components'\nimport type { Options as ServerOptions } from '../next-server'\nimport type { Params } from '../request/params'\nimport type { ParsedUrl } from '../../shared/lib/router/utils/parse-url'\nimport type { ParsedUrlQuery } from 'querystring'\nimport type { UrlWithParsedQuery } from 'url'\nimport type { MiddlewareRoutingItem } from '../base-server'\nimport type { RouteDefinition } from '../route-definitions/route-definition'\nimport type { RouteMatcherManager } from '../route-matcher-managers/route-matcher-manager'\n\nimport {\n  addRequestMeta,\n  getRequestMeta,\n  type NextParsedUrlQuery,\n  type NextUrlWithParsedQuery,\n} from '../request-meta'\nimport type { DevBundlerService } from '../lib/dev-bundler-service'\nimport type { IncrementalCache } from '../lib/incremental-cache'\nimport type { UnwrapPromise } from '../../lib/coalesced-function'\nimport type { NodeNextResponse, NodeNextRequest } from '../base-http/node'\nimport type { RouteEnsurer } from '../route-matcher-managers/dev-route-matcher-manager'\nimport type { PagesManifest } from '../../build/webpack/plugins/pages-manifest-plugin'\n\nimport * as React from 'react'\nimport fs from 'fs'\nimport { Worker } from 'next/dist/compiled/jest-worker'\nimport { installUseCacheProbe } from './use-cache-probe-pool'\nimport { installDevValidationWorker } from './dev-validation-worker-pool'\nimport { join as pathJoin } from 'path'\nimport { PUBLIC_DIR_MIDDLEWARE_CONFLICT } from '../../lib/constants'\nimport { findPagesDir } from '../../lib/find-pages-dir'\nimport {\n  PHASE_DEVELOPMENT_SERVER,\n  PAGES_MANIFEST,\n  APP_PATHS_MANIFEST,\n  COMPILER_NAMES,\n  PRERENDER_MANIFEST,\n} from '../../shared/lib/constants'\nimport Server, { WrappedBuildError } from '../next-server'\nimport { normalizePagePath } from '../../shared/lib/page-path/normalize-page-path'\nimport { pathHasPrefix } from '../../shared/lib/router/utils/path-has-prefix'\nimport { removePathPrefix } from '../../shared/lib/router/utils/remove-path-prefix'\nimport { Telemetry } from '../../telemetry/storage'\nimport {\n  type Span,\n  hrtimeToEpochNanoseconds,\n  setGlobal,\n  trace,\n} from '../../trace'\nimport { traceGlobals } from '../../trace/shared'\nimport { findPageFile } from '../lib/find-page-file'\nimport { getFormattedNodeOptionsWithoutInspect } from '../lib/utils'\nimport { withCoalescedInvoke } from '../../lib/coalesced-function'\nimport {\n  loadDefaultErrorComponents,\n  type ErrorModule,\n} from '../load-default-error-components'\nimport { DecodeError, MiddlewareNotFoundError } from '../../shared/lib/utils'\nimport * as Log from '../../build/output/log'\nimport isError, { getProperError } from '../../lib/is-error'\nimport { defaultConfig, type NextConfigComplete } from '../config-shared'\nimport { isMiddlewareFile } from '../../build/utils'\nimport { formatServerError } from '../../lib/format-server-error'\nimport { DevRouteMatcherManager } from '../route-matcher-managers/dev-route-matcher-manager'\nimport { DevPagesRouteMatcherProvider } from '../route-matcher-providers/dev/dev-pages-route-matcher-provider'\nimport { DevPagesAPIRouteMatcherProvider } from '../route-matcher-providers/dev/dev-pages-api-route-matcher-provider'\nimport { DevAppPageRouteMatcherProvider } from '../route-matcher-providers/dev/dev-app-page-route-matcher-provider'\nimport { DevAppRouteRouteMatcherProvider } from '../route-matcher-providers/dev/dev-app-route-route-matcher-provider'\nimport { NodeManifestLoader } from '../route-matcher-providers/helpers/manifest-loaders/node-manifest-loader'\nimport { BatchedFileReader } from '../route-matcher-providers/dev/helpers/file-reader/batched-file-reader'\nimport { DefaultFileReader } from '../route-matcher-providers/dev/helpers/file-reader/default-file-reader'\nimport { LRUCache } from '../lib/lru-cache'\nimport { getMiddlewareRouteMatcher } from '../../shared/lib/router/utils/middleware-route-matcher'\nimport { DetachedPromise } from '../../lib/detached-promise'\nimport {\n  isUnhandledRejectionListenerRegistered,\n  registerUnhandledRejectionListener,\n} from '../node-environment-extensions/process-error-handlers'\nimport { generateInterceptionRoutesRewrites } from '../../lib/generate-interception-routes-rewrites'\nimport { buildCustomRoute } from '../../lib/build-custom-route'\nimport { decorateServerError } from '../../shared/lib/error-source'\nimport type { ServerOnInstrumentationRequestError } from '../app-render/types'\nimport type { ServerComponentsHmrCache } from '../response-cache'\nimport { logRequests } from './log-requests'\nimport { FallbackMode, fallbackModeToFallbackField } from '../../lib/fallback'\nimport type { PagesDevOverlayBridgeType } from '../../next-devtools/userspace/pages/pages-dev-overlay-setup'\nimport {\n  ensureInstrumentationRegistered,\n  getInstrumentationModule,\n} from '../lib/router-utils/instrumentation-globals.external'\nimport type { PrerenderManifest } from '../../build'\nimport { getRouteRegex } from '../../shared/lib/router/utils/route-regex'\nimport type { PrerenderedRoute } from '../../build/static-paths/types'\nimport { HMR_MESSAGE_SENT_TO_BROWSER } from './hot-reloader-types'\nimport { registerLocalSpanRecorder } from '../lib/trace/local-span-recorder'\n\nregisterLocalSpanRecorder()\n\n// Load ReactDevOverlay only when needed\nlet PagesDevOverlayBridgeImpl: PagesDevOverlayBridgeType\nconst ReactDevOverlay: PagesDevOverlayBridgeType = (props) => {\n  if (PagesDevOverlayBridgeImpl === undefined) {\n    PagesDevOverlayBridgeImpl = (\n      require('../../next-devtools/userspace/pages/pages-dev-overlay-setup') as typeof import('../../next-devtools/userspace/pages/pages-dev-overlay-setup')\n    ).PagesDevOverlayBridge\n  }\n  return React.createElement(PagesDevOverlayBridgeImpl, props)\n}\n\nexport interface Options extends ServerOptions {\n  // Override type to make the full config available instead of only NextConfigRuntime\n  conf: NextConfigComplete\n  /**\n   * Tells of Next.js is running from the `next dev` command\n   */\n  isNextDevCommand?: boolean\n\n  /**\n   * Interface to the development bundler.\n   */\n  bundlerService: DevBundlerService\n\n  /**\n   * Trace span for server startup.\n   */\n  startServerSpan: Span\n}\n\nexport default class DevServer extends Server {\n  // Override type to make the full config available instead of only NextConfigRuntime\n  protected readonly nextConfig: NextConfigComplete\n\n  /**\n   * The promise that resolves when the server is ready. When this is unset\n   * the server is ready.\n   */\n  private ready? = new DetachedPromise<void>()\n  protected sortedRoutes?: string[]\n  private pagesDir?: string\n  private appDir?: string\n  private actualMiddlewareFile?: string\n  private actualInstrumentationHookFile?: string\n  private middleware?: MiddlewareRoutingItem\n  private readonly bundlerService: DevBundlerService\n  private staticPathsCache: LRUCache<\n    UnwrapPromise<ReturnType<DevServer['getStaticPaths']>>\n  >\n  private startServerSpan: Span\n  private readonly serverComponentsHmrCache:\n    | ServerComponentsHmrCache\n    | undefined\n\n  protected staticPathsWorker?: { [key: string]: any } & {\n    loadStaticPaths: typeof import('./static-paths-worker').loadStaticPaths\n  }\n\n  private getStaticPathsWorker(): { [key: string]: any } & {\n    loadStaticPaths: typeof import('./static-paths-worker').loadStaticPaths\n  } {\n    const worker = new Worker(require.resolve('./static-paths-worker'), {\n      maxRetries: 1,\n      // For dev server, it's not necessary to spin up too many workers as long as you are not doing a load test.\n      // This helps reusing the memory a lot.\n      numWorkers: 1,\n      enableWorkerThreads: this.nextConfig.experimental.workerThreads,\n      forkOptions: {\n        env: {\n          ...process.env,\n          // discard --inspect/--inspect-brk flags from process.env.NODE_OPTIONS. Otherwise multiple Node.js debuggers\n          // would be started if user launch Next.js in debugging mode. The number of debuggers is linked to\n          // the number of workers Next.js tries to launch. The only worker users are interested in debugging\n          // is the main Next.js one\n          NODE_OPTIONS: getFormattedNodeOptionsWithoutInspect(),\n        },\n      },\n    }) as Worker & {\n      loadStaticPaths: typeof import('./static-paths-worker').loadStaticPaths\n    }\n\n    worker.getStdout().pipe(process.stdout)\n    worker.getStderr().pipe(process.stderr)\n\n    return worker\n  }\n\n  constructor(options: Options) {\n    try {\n      // Increase the number of stack frames on the server\n      Error.stackTraceLimit = 50\n    } catch {}\n    super({ ...options, dev: true })\n    this.nextConfig = options.conf\n    this.bundlerService = options.bundlerService\n    this.startServerSpan =\n      options.startServerSpan ?? trace('start-next-dev-server')\n    this.renderOpts.ErrorDebug = ReactDevOverlay\n    this.staticPathsCache = new LRUCache(\n      // 5MB\n      5 * 1024 * 1024,\n      function length(value, cacheKey) {\n        // Ensure minimum size of 1 for LRU eviction to work correctly\n        return (\n          cacheKey.length + (JSON.stringify(value.staticPaths)?.length || 1)\n        )\n      }\n    )\n\n    const { pagesDir, appDir } = findPagesDir(this.dir)\n    this.pagesDir = pagesDir\n    this.appDir = appDir\n\n    if (this.nextConfig.experimental.serverComponentsHmrCache) {\n      // Ensure HMR cache has a minimum size equal to the default cacheMaxMemorySize,\n      // but allow it to grow if the user has configured a larger value.\n      const hmrCacheSize = Math.max(\n        this.nextConfig.cacheMaxMemorySize,\n        defaultConfig.cacheMaxMemorySize\n      )\n      this.serverComponentsHmrCache = new LRUCache(\n        hmrCacheSize,\n        function length(value, cacheKey) {\n          return cacheKey.length + JSON.stringify(value).length\n        }\n      )\n    }\n\n    installUseCacheProbe({\n      distDir: this.distDir,\n      buildId: this.buildId,\n      deploymentId: this.deploymentId,\n      nextConfig: this.nextConfig,\n    })\n\n    // Runs Cache Components dev validation on a worker thread, off the main\n    // thread, so validation renders don't block the event loop during rapid\n    // navigation. Gated by `experimental.devValidationWorker`. The worker is\n    // spawned lazily on the first navigation that validates, so this install is\n    // free when a project doesn't use Cache Components.\n    //\n    // Turbopack only, because the worker's thread has source maps just for the\n    // chunks it loaded itself, and resolves the rest by reading the `.map`\n    // Turbopack writes next to each chunk. Webpack keeps its dev source maps in\n    // the compiler, which the worker's thread cannot reach, so validation\n    // errors would be reported without a source location. Running validation on\n    // the main thread costs dev performance but keeps those frames intact.\n    if (\n      process.env.TURBOPACK &&\n      this.nextConfig.experimental.devValidationWorker !== false\n    ) {\n      installDevValidationWorker({\n        distDir: this.distDir,\n        buildId: this.buildId,\n        deploymentId: this.deploymentId,\n        nextConfig: this.nextConfig,\n      })\n    }\n  }\n\n  protected override getServerComponentsHmrCache() {\n    return this.serverComponentsHmrCache\n  }\n\n  protected override getServerComponentsHmrRefreshHash(): string | undefined {\n    return this.bundlerService.getServerComponentsHmrRefreshHash()\n  }\n\n  protected getRouteMatchers(): RouteMatcherManager {\n    const { pagesDir, appDir } = findPagesDir(this.dir)\n\n    const ensurer: RouteEnsurer = {\n      ensure: async (match, pathname) => {\n        await this.ensurePage({\n          definition: match.definition,\n          page: match.definition.page,\n          clientOnly: false,\n          url: pathname,\n        })\n      },\n    }\n\n    const matchers = new DevRouteMatcherManager(\n      super.getRouteMatchers(),\n      ensurer,\n      this.dir\n    )\n    const extensions = this.nextConfig.pageExtensions\n    const extensionsExpression = new RegExp(`\\\\.(?:${extensions.join('|')})$`)\n\n    // If the pages directory is available, then configure those matchers.\n    if (pagesDir) {\n      const fileReader = new BatchedFileReader(\n        new DefaultFileReader({\n          // Only allow files that have the correct extensions.\n          pathnameFilter: (pathname) => extensionsExpression.test(pathname),\n        })\n      )\n\n      matchers.push(\n        new DevPagesRouteMatcherProvider(\n          pagesDir,\n          extensions,\n          fileReader,\n          this.localeNormalizer\n        )\n      )\n      matchers.push(\n        new DevPagesAPIRouteMatcherProvider(\n          pagesDir,\n          extensions,\n          fileReader,\n          this.localeNormalizer\n        )\n      )\n    }\n\n    if (appDir) {\n      // We create a new file reader for the app directory because we don't want\n      // to include any folders or files starting with an underscore. This will\n      // prevent the reader from wasting time reading files that we know we\n      // don't care about.\n      const fileReader = new BatchedFileReader(\n        new DefaultFileReader({\n          // Ignore any directory prefixed with an underscore.\n          ignorePartFilter: (part) => part.startsWith('_'),\n        })\n      )\n\n      // TODO: Improve passing of \"is running with Turbopack\"\n      const isTurbopack = !!process.env.TURBOPACK\n      matchers.push(\n        new DevAppPageRouteMatcherProvider(\n          appDir,\n          extensions,\n          fileReader,\n          isTurbopack\n        )\n      )\n      matchers.push(\n        new DevAppRouteRouteMatcherProvider(\n          appDir,\n          extensions,\n          fileReader,\n          isTurbopack\n        )\n      )\n    }\n\n    return matchers\n  }\n\n  protected getBuildId(): string {\n    return 'development'\n  }\n\n  protected async prepareImpl(): Promise<void> {\n    setGlobal('distDir', this.distDir)\n    setGlobal('phase', PHASE_DEVELOPMENT_SERVER)\n\n    // Use existing telemetry instance from traceGlobals instead of creating a new one.\n    // Creating a new instance would overwrite the existing one, causing any telemetry\n    // events recorded to the original instance to be lost during cleanup/flush.\n    const existingTelemetry = traceGlobals.get('telemetry')\n    const telemetry =\n      existingTelemetry || new Telemetry({ distDir: this.distDir })\n\n    await super.prepareImpl()\n    await this.matchers.reload()\n\n    this.ready?.resolve()\n    this.ready = undefined\n\n    // In dev, this needs to be called after prepare because the build entries won't be known in the constructor\n    this.interceptionRoutePatterns = this.getinterceptionRoutePatterns()\n\n    // This is required by the tracing subsystem.\n    setGlobal('appDir', this.appDir)\n    setGlobal('pagesDir', this.pagesDir)\n    // Only set telemetry if it wasn't already set\n    if (!existingTelemetry) {\n      setGlobal('telemetry', telemetry)\n    }\n\n    // The router server or the render server may run in the same process and\n    // have already registered the unhandled rejection listener, in which case\n    // we must not register another one, to avoid logging unhandled rejections\n    // multiple times.\n    if (!isUnhandledRejectionListenerRegistered()) {\n      registerUnhandledRejectionListener()\n    }\n\n    process.on('uncaughtException', (err) => {\n      this.logErrorWithOriginalStack(err, 'uncaughtException')\n    })\n  }\n\n  protected async hasPage(pathname: string): Promise<boolean> {\n    let normalizedPath: string\n    try {\n      normalizedPath = normalizePagePath(pathname)\n    } catch (err) {\n      console.error(err)\n      // if normalizing the page fails it means it isn't valid\n      // so it doesn't exist so don't throw and return false\n      // to ensure we return 404 instead of 500\n      return false\n    }\n\n    if (isMiddlewareFile(normalizedPath)) {\n      return findPageFile(\n        this.dir,\n        normalizedPath,\n        this.nextConfig.pageExtensions,\n        false\n      ).then(Boolean)\n    }\n\n    let appFile: string | null = null\n    let pagesFile: string | null = null\n\n    if (this.appDir) {\n      appFile = await findPageFile(\n        this.appDir,\n        normalizedPath + '/page',\n        this.nextConfig.pageExtensions,\n        true\n      )\n    }\n\n    if (this.pagesDir) {\n      pagesFile = await findPageFile(\n        this.pagesDir,\n        normalizedPath,\n        this.nextConfig.pageExtensions,\n        false\n      )\n    }\n    if (appFile && pagesFile) {\n      return false\n    }\n\n    return Boolean(appFile || pagesFile)\n  }\n\n  async runMiddleware(params: {\n    request: NodeNextRequest\n    response: NodeNextResponse\n    parsedUrl: ParsedUrl\n    parsed: UrlWithParsedQuery\n    middlewareList: MiddlewareRoutingItem[]\n  }) {\n    try {\n      const result = await super.runMiddleware({\n        ...params,\n        onWarning: (warn) => {\n          this.logErrorWithOriginalStack(warn, 'warning')\n        },\n      })\n\n      if ('finished' in result) {\n        return result\n      }\n\n      result.waitUntil.catch((error) => {\n        this.logErrorWithOriginalStack(error, 'unhandledRejection')\n      })\n      return result\n    } catch (error) {\n      if (error instanceof DecodeError) {\n        throw error\n      }\n\n      /**\n       * We only log the error when it is not a MiddlewareNotFound error as\n       * in that case we should be already displaying a compilation error\n       * which is what makes the module not found.\n       */\n      if (!(error instanceof MiddlewareNotFoundError)) {\n        this.logErrorWithOriginalStack(error)\n      }\n\n      const err = getProperError(error)\n      decorateServerError(err, COMPILER_NAMES.edgeServer)\n      const { request, response, parsedUrl } = params\n\n      /**\n       * When there is a failure for an internal Next.js request from\n       * middleware we bypass the error without finishing the request\n       * so we can serve the required chunks to render the error.\n       */\n      if (\n        request.url.includes('/_next/static') ||\n        request.url.includes('/__nextjs_attach-nodejs-inspector') ||\n        request.url.includes('/__nextjs_original-stack-frame') ||\n        request.url.includes('/__nextjs_source-map') ||\n        request.url.includes('/__nextjs_error_feedback')\n      ) {\n        return { finished: false }\n      }\n\n      response.statusCode = 500\n      await this.renderError(err, request, response, parsedUrl.pathname)\n      return { finished: true }\n    }\n  }\n\n  async runEdgeFunction(params: {\n    req: NodeNextRequest\n    res: NodeNextResponse\n    query: ParsedUrlQuery\n    params: Params | undefined\n    page: string\n    appPaths: string[] | null\n    isAppPath: boolean\n  }) {\n    try {\n      return super.runEdgeFunction({\n        ...params,\n        onError: (err) => this.logErrorWithOriginalStack(err, 'app-dir'),\n        onWarning: (warn) => {\n          this.logErrorWithOriginalStack(warn, 'warning')\n        },\n      })\n    } catch (error) {\n      if (error instanceof DecodeError) {\n        throw error\n      }\n      this.logErrorWithOriginalStack(error, 'warning')\n      const err = getProperError(error)\n      const { req, res, page } = params\n\n      res.statusCode = 500\n      await this.renderError(err, req, res, page)\n      return null\n    }\n  }\n\n  public getRequestHandler(): NodeRequestHandler {\n    const handler = super.getRequestHandler()\n\n    return (req, res, parsedUrl) => {\n      const request = this.normalizeReq(req)\n      const response = this.normalizeRes(res)\n      const loggingConfig = this.nextConfig.logging\n\n      if (loggingConfig !== false) {\n        // The closure variable is not used here because the request handler may be invoked twice for one request when middleware is added in the application.\n        // By setting the start time we can ensure that the middleware timing is correctly included.\n        if (!getRequestMeta(req, 'devRequestTimingStart')) {\n          const requestStart = process.hrtime.bigint()\n          addRequestMeta(req, 'devRequestTimingStart', requestStart)\n        }\n        const isMiddlewareRequest =\n          getRequestMeta(req, 'middlewareInvoke') ?? false\n\n        if (!isMiddlewareRequest) {\n          response.originalResponse.once('close', () => {\n            // NOTE: The route match is only attached to the request's meta data\n            // after the request handler is created, so we need to check it in the\n            // close handler and not before.\n            const routeMatch = getRequestMeta(req).match\n\n            if (!routeMatch) {\n              return\n            }\n\n            // The closure variable is not used here because the request handler may be invoked twice for one request when middleware is added in the application.\n            // By setting the start time we can ensure that the middleware timing is correctly included.\n            const requestStart = getRequestMeta(req, 'devRequestTimingStart')\n            if (!requestStart) {\n              return\n            }\n            const requestEnd = process.hrtime.bigint()\n            logRequests(\n              request,\n              response,\n              loggingConfig,\n              requestStart,\n              requestEnd,\n              getRequestMeta(req, 'devRequestTimingMiddlewareStart'),\n              getRequestMeta(req, 'devRequestTimingMiddlewareEnd'),\n              getRequestMeta(req, 'devRequestTimingInternalsEnd'),\n              getRequestMeta(req, 'devGenerateStaticParamsDuration')\n            )\n\n            // Create trace span for render phase\n            const devRequestTimingInternalsEnd = getRequestMeta(\n              req,\n              'devRequestTimingInternalsEnd'\n            )\n            if (devRequestTimingInternalsEnd) {\n              this.startServerSpan.manualTraceChild(\n                'render-path',\n                hrtimeToEpochNanoseconds(devRequestTimingInternalsEnd),\n                hrtimeToEpochNanoseconds(requestEnd),\n                { path: req.url || '' }\n              )\n            }\n          })\n        }\n      }\n\n      return handler(request, response, parsedUrl)\n    }\n  }\n\n  public async handleRequest(\n    req: NodeNextRequest,\n    res: NodeNextResponse,\n    parsedUrl?: NextUrlWithParsedQuery\n  ): Promise<void> {\n    const span = trace('handle-request', undefined, { url: req.url })\n    const result = await span.traceAsyncFn(async () => {\n      await this.ready?.promise\n      addRequestMeta(req, 'PagesErrorDebug', this.renderOpts.ErrorDebug)\n      return await super.handleRequest(req, res, parsedUrl)\n    })\n    const memoryUsage = process.memoryUsage()\n    span\n      .traceChild('memory-usage', {\n        url: req.url,\n        'memory.rss': String(memoryUsage.rss),\n        'memory.heapUsed': String(memoryUsage.heapUsed),\n        'memory.heapTotal': String(memoryUsage.heapTotal),\n      })\n      .stop()\n    return result\n  }\n\n  async run(\n    req: NodeNextRequest,\n    res: NodeNextResponse,\n    parsedUrl: UrlWithParsedQuery\n  ): Promise<void> {\n    await this.ready?.promise\n\n    const { basePath } = this.nextConfig\n    let originalPathname: string | null = null\n\n    // TODO: see if we can remove this in the future\n    if (basePath && pathHasPrefix(parsedUrl.pathname || '/', basePath)) {\n      // strip basePath before handling dev bundles\n      // If replace ends up replacing the full url it'll be `undefined`, meaning we have to default it to `/`\n      originalPathname = parsedUrl.pathname\n      parsedUrl.pathname = removePathPrefix(parsedUrl.pathname || '/', basePath)\n    }\n\n    const { pathname } = parsedUrl\n\n    if (pathname!.startsWith('/_next')) {\n      if (fs.existsSync(pathJoin(this.publicDir, '_next'))) {\n        throw new Error(PUBLIC_DIR_MIDDLEWARE_CONFLICT)\n      }\n    }\n\n    if (originalPathname) {\n      // restore the path before continuing so that custom-routes can accurately determine\n      // if they should match against the basePath or not\n      parsedUrl.pathname = originalPathname\n    }\n    try {\n      return await super.run(req, res, parsedUrl)\n    } catch (error) {\n      const err = getProperError(error)\n      formatServerError(err)\n      this.logErrorWithOriginalStack(err)\n      if (!res.sent) {\n        res.statusCode = 500\n        try {\n          return await this.renderError(err, req, res, pathname!, {\n            __NEXT_PAGE: (isError(err) && err.page) || pathname || '',\n          })\n        } catch (internalErr) {\n          console.error(internalErr)\n          res.body('Internal Server Error').send()\n        }\n      }\n    }\n  }\n\n  protected logErrorWithOriginalStack(\n    err?: unknown,\n    type?: 'unhandledRejection' | 'uncaughtException' | 'warning' | 'app-dir'\n  ): void {\n    this.bundlerService.logErrorWithOriginalStack(err, type)\n  }\n\n  protected getPagesManifest(): PagesManifest | undefined {\n    return (\n      NodeManifestLoader.require(\n        pathJoin(this.serverDistDir, PAGES_MANIFEST)\n      ) ?? undefined\n    )\n  }\n\n  protected getAppPathsManifest(): PagesManifest | undefined {\n    if (!this.enabledDirectories.app) return undefined\n\n    return (\n      NodeManifestLoader.require(\n        pathJoin(this.serverDistDir, APP_PATHS_MANIFEST)\n      ) ?? undefined\n    )\n  }\n\n  protected getinterceptionRoutePatterns(): RegExp[] {\n    const rewrites = generateInterceptionRoutesRewrites(\n      Object.keys(this.appPathRoutes ?? {}),\n      this.nextConfig.basePath\n    ).map((route) => new RegExp(buildCustomRoute('rewrite', route).regex))\n\n    if (this.nextConfig.output === 'export' && rewrites.length > 0) {\n      Log.error(\n        'Intercepting routes are not supported with static export.\\nRead more: https://nextjs.org/docs/app/building-your-application/deploying/static-exports#unsupported-features'\n      )\n\n      process.exit(1)\n    }\n\n    return rewrites ?? []\n  }\n\n  protected async getMiddleware() {\n    // We need to populate the match\n    // field as it isn't serializable\n    if (this.middleware?.match === null) {\n      this.middleware.match = getMiddlewareRouteMatcher(\n        this.middleware.matchers || []\n      )\n    }\n    return this.middleware\n  }\n\n  protected getNextFontManifest() {\n    return undefined\n  }\n\n  protected async hasMiddleware(): Promise<boolean> {\n    return this.hasPage(this.actualMiddlewareFile!)\n  }\n\n  protected async ensureMiddleware(url: string) {\n    return this.ensurePage({\n      page: this.actualMiddlewareFile!,\n      clientOnly: false,\n      definition: undefined,\n      url,\n    })\n  }\n\n  protected async loadInstrumentationModule(): Promise<any> {\n    let instrumentationModule: any\n    if (\n      this.actualInstrumentationHookFile &&\n      (await this.ensurePage({\n        page: this.actualInstrumentationHookFile!,\n        clientOnly: false,\n        definition: undefined,\n      })\n        .then(() => true)\n        .catch(() => false))\n    ) {\n      try {\n        instrumentationModule = await getInstrumentationModule(\n          this.dir,\n          this.nextConfig.distDir\n        )\n      } catch (err: any) {\n        err.message = `An error occurred while loading instrumentation hook: ${err.message}`\n        throw err\n      }\n    }\n    return instrumentationModule\n  }\n\n  protected async runInstrumentationHookIfAvailable() {\n    await ensureInstrumentationRegistered(this.dir, this.nextConfig.distDir)\n  }\n\n  protected async ensureEdgeFunction({\n    page,\n    appPaths,\n    url,\n  }: {\n    page: string\n    appPaths: string[] | null\n    url: string\n  }) {\n    return this.ensurePage({\n      page,\n      appPaths,\n      clientOnly: false,\n      definition: undefined,\n      url,\n    })\n  }\n\n  generateRoutes(_dev?: boolean) {\n    // In development we expose all compiled files for react-error-overlay's line show feature\n    // We use unshift so that we're sure the routes is defined before Next's default routes\n    // routes.unshift({\n    //   match: getPathMatch('/_next/development/:path*'),\n    //   type: 'route',\n    //   name: '_next/development catchall',\n    //   fn: async (req, res, params) => {\n    //     const p = pathJoin(this.distDir, ...(params.path || []))\n    //     await this.serveStatic(req, res, p)\n    //     return {\n    //       finished: true,\n    //     }\n    //   },\n    // })\n  }\n\n  protected async getStaticPaths({\n    pathname,\n    urlPathname,\n    requestHeaders,\n    page,\n    isAppPath,\n  }: {\n    pathname: string\n    urlPathname: string\n    requestHeaders: IncrementalCache['requestHeaders']\n    page: string\n    isAppPath: boolean\n  }): Promise<{\n    prerenderedRoutes?: PrerenderedRoute[]\n    staticPaths?: string[]\n    fallbackMode?: FallbackMode\n  }> {\n    // we lazy load the staticPaths to prevent the user\n    // from waiting on them for the page to load in dev mode\n\n    const __getStaticPaths = async () => {\n      const { configFileName, httpAgentOptions } = this.nextConfig\n      const { locales, defaultLocale } = this.nextConfig.i18n || {}\n      const staticPathsWorker = this.getStaticPathsWorker()\n\n      try {\n        const pathsResult = await staticPathsWorker.loadStaticPaths({\n          dir: this.dir,\n          distDir: this.distDir,\n          pathname,\n          config: {\n            pprConfig: this.nextConfig.experimental.ppr,\n            configFileName,\n            cacheComponents: Boolean(this.nextConfig.cacheComponents),\n          },\n          httpAgentOptions,\n          locales,\n          defaultLocale,\n          page,\n          isAppPath,\n          requestHeaders,\n          cacheHandler: this.nextConfig.cacheHandler,\n          cacheHandlers: this.nextConfig.cacheHandlers,\n          cacheLifeProfiles: this.nextConfig.cacheLife,\n          fetchCacheKeyPrefix: this.nextConfig.experimental.fetchCacheKeyPrefix,\n          isrFlushToDisk: this.nextConfig.experimental.isrFlushToDisk,\n          cacheMaxMemorySize: this.nextConfig.cacheMaxMemorySize,\n          nextConfigOutput: this.nextConfig.output,\n          buildId: this.buildId,\n          deploymentId: this.deploymentId,\n          authInterrupts: Boolean(this.nextConfig.experimental.authInterrupts),\n          useCacheTimeout: this.nextConfig.experimental.useCacheTimeout,\n          staticPageGenerationTimeout:\n            this.nextConfig.staticPageGenerationTimeout,\n          sriEnabled: Boolean(this.nextConfig.experimental.sri?.algorithm),\n        })\n        return pathsResult\n      } finally {\n        // we don't re-use workers so destroy the used one\n        staticPathsWorker.end()\n      }\n    }\n    const result = this.staticPathsCache.get(pathname)\n\n    const nextInvoke = withCoalescedInvoke(__getStaticPaths)(\n      `staticPaths-${pathname}`,\n      []\n    )\n      .then(async (res) => {\n        const { prerenderedRoutes, fallbackMode: fallback } = res.value\n\n        if (isAppPath) {\n          if (this.nextConfig.output === 'export') {\n            if (!prerenderedRoutes) {\n              throw new Error(\n                `Page \"${page}\" is missing exported function \"generateStaticParams()\", which is required with \"output: export\" config. See more info here: https://nextjs.org/docs/messages/generate-static-params`\n              )\n            }\n\n            if (\n              !prerenderedRoutes.some((item) => item.pathname === urlPathname)\n            ) {\n              throw new Error(\n                `Page \"${page}\" is missing param \"${pathname}\" in \"generateStaticParams()\", which is required with \"output: export\" config.`\n              )\n            }\n          }\n        }\n\n        if (!isAppPath && this.nextConfig.output === 'export') {\n          if (fallback === FallbackMode.BLOCKING_STATIC_RENDER) {\n            throw new Error(\n              'getStaticPaths with \"fallback: blocking\" cannot be used with \"output: export\". See more info here: https://nextjs.org/docs/advanced-features/static-html-export'\n            )\n          } else if (fallback === FallbackMode.PRERENDER) {\n            throw new Error(\n              'getStaticPaths with \"fallback: true\" cannot be used with \"output: export\". See more info here: https://nextjs.org/docs/advanced-features/static-html-export'\n            )\n          }\n        }\n\n        const value: {\n          staticPaths: string[] | undefined\n          prerenderedRoutes: PrerenderedRoute[] | undefined\n          fallbackMode: FallbackMode | undefined\n        } = {\n          staticPaths: prerenderedRoutes?.map((route) => route.pathname),\n          prerenderedRoutes,\n          fallbackMode: fallback,\n        }\n\n        if (\n          res.value?.fallbackMode !== undefined &&\n          // This matches the hasGenerateStaticParams logic we do during build.\n          (!isAppPath || (prerenderedRoutes && prerenderedRoutes.length > 0))\n        ) {\n          // we write the static paths to partial manifest for\n          // fallback handling inside of entry handler's\n          const rawExistingManifest = await fs.promises.readFile(\n            pathJoin(this.distDir, PRERENDER_MANIFEST),\n            'utf8'\n          )\n          const existingManifest: PrerenderManifest =\n            JSON.parse(rawExistingManifest)\n          for (const staticPath of value.staticPaths || []) {\n            existingManifest.routes[staticPath] = {} as any\n          }\n\n          // Find the fallback route from the prerendered routes. This is\n          // the route whose pathname matches the page pattern (e.g.\n          // /dynamic-params/[slug]) and has fallback route params describing\n          // which params are unknown at build time.\n          const fallbackPrerenderedRoute = prerenderedRoutes?.find(\n            (route) => route.pathname === pathname\n          )\n\n          existingManifest.dynamicRoutes[pathname] = {\n            dataRoute: null,\n            dataRouteRegex: null,\n            fallback: fallbackModeToFallbackField(res.value.fallbackMode, page),\n            fallbackRevalidate: false,\n            fallbackExpire: undefined,\n            fallbackHeaders: undefined,\n            fallbackStatus: undefined,\n            fallbackRootParams: fallbackPrerenderedRoute?.fallbackRootParams,\n            fallbackRouteParams: fallbackPrerenderedRoute?.fallbackRouteParams,\n            fallbackSourceRoute: pathname,\n            prefetchDataRoute: undefined,\n            prefetchDataRouteRegex: undefined,\n            routeRegex: getRouteRegex(pathname).re.source,\n            experimentalPPR: undefined,\n            renderingMode: undefined,\n            allowHeader: [],\n          }\n\n          const updatedManifest = JSON.stringify(existingManifest)\n\n          if (updatedManifest !== rawExistingManifest) {\n            await fs.promises.writeFile(\n              pathJoin(this.distDir, PRERENDER_MANIFEST),\n              updatedManifest\n            )\n          }\n        }\n        this.staticPathsCache.set(pathname, value)\n\n        // Since generateStaticParams runs in the background, the fallbackParams\n        // accessed during a render are derived from the previous result served\n        // by the static paths cache. Now that the cache holds the new result,\n        // trigger a refresh so the next render picks up the new fallbackParams\n        // (e.g. so blocking-route validation reflects params that just became\n        // statically known).\n        if (\n          isAppPath &&\n          this.nextConfig.cacheComponents &&\n          // Ensure this is not the first invocation.\n          result &&\n          // Comparing lengths rather than the whole objects, which is too\n          // expensive.\n          result.prerenderedRoutes?.length !== prerenderedRoutes?.length\n        ) {\n          this.bundlerService.sendHmrMessage({\n            type: HMR_MESSAGE_SENT_TO_BROWSER.STATIC_PARAMS_CHANGED,\n          })\n        }\n\n        return value\n      })\n      .catch((err) => {\n        this.staticPathsCache.remove(pathname)\n        if (!result) throw err\n        Log.error(`Failed to generate static paths for ${pathname}:`)\n        console.error(err)\n      })\n\n    if (result) {\n      return result\n    }\n    return nextInvoke as NonNullable<typeof result>\n  }\n\n  protected async ensurePage(opts: {\n    page: string\n    clientOnly: boolean\n    appPaths?: ReadonlyArray<string> | null\n    definition: RouteDefinition | undefined\n    url?: string\n  }): Promise<void> {\n    await this.bundlerService.ensurePage(opts)\n  }\n\n  protected async findPageComponents({\n    locale,\n    page,\n    query,\n    params,\n    isAppPath,\n    appPaths = null,\n    shouldEnsure,\n    url,\n  }: {\n    locale: string | undefined\n    page: string\n    query: NextParsedUrlQuery\n    params: Params\n    isAppPath: boolean\n    sriEnabled?: boolean\n    appPaths?: ReadonlyArray<string> | null\n    shouldEnsure: boolean\n    url?: string\n  }): Promise<FindComponentsResult | null> {\n    await this.ready?.promise\n\n    const compilationErr = await this.getCompilationError(page)\n    if (compilationErr) {\n      // Wrap build errors so that they don't get logged again\n      throw new WrappedBuildError(compilationErr)\n    }\n    if (shouldEnsure || this.serverOptions.customServer) {\n      await this.ensurePage({\n        page,\n        appPaths,\n        clientOnly: false,\n        definition: undefined,\n        url,\n      })\n    }\n\n    this.nextFontManifest = super.getNextFontManifest()\n\n    return await super.findPageComponents({\n      page,\n      query,\n      params,\n      locale,\n      isAppPath,\n      shouldEnsure,\n      url,\n    })\n  }\n\n  protected async getFallbackErrorComponents(\n    url?: string\n  ): Promise<LoadComponentsReturnType<ErrorModule> | null> {\n    await this.bundlerService.getFallbackErrorComponents(url)\n    return await loadDefaultErrorComponents(this.distDir)\n  }\n\n  async getCompilationError(page: string): Promise<any> {\n    return await this.bundlerService.getCompilationError(page)\n  }\n\n  protected async instrumentationOnRequestError(\n    ...args: Parameters<ServerOnInstrumentationRequestError>\n  ) {\n    await super.instrumentationOnRequestError(...args)\n\n    const [err, , , silenceLog] = args\n    if (!silenceLog) {\n      this.logErrorWithOriginalStack(err, 'app-dir')\n    }\n  }\n}\n"],"names":["DevServer","registerLocalSpanRecorder","PagesDevOverlayBridgeImpl","ReactDevOverlay","props","undefined","require","PagesDevOverlayBridge","React","createElement","Server","getStaticPathsWorker","worker","Worker","resolve","maxRetries","numWorkers","enableWorkerThreads","nextConfig","experimental","workerThreads","forkOptions","env","process","NODE_OPTIONS","getFormattedNodeOptionsWithoutInspect","getStdout","pipe","stdout","getStderr","stderr","constructor","options","Error","stackTraceLimit","dev","ready","DetachedPromise","conf","bundlerService","startServerSpan","trace","renderOpts","ErrorDebug","staticPathsCache","LRUCache","length","value","cacheKey","JSON","stringify","staticPaths","pagesDir","appDir","findPagesDir","dir","serverComponentsHmrCache","hmrCacheSize","Math","max","cacheMaxMemorySize","defaultConfig","installUseCacheProbe","distDir","buildId","deploymentId","TURBOPACK","devValidationWorker","installDevValidationWorker","getServerComponentsHmrCache","getServerComponentsHmrRefreshHash","getRouteMatchers","ensurer","ensure","match","pathname","ensurePage","definition","page","clientOnly","url","matchers","DevRouteMatcherManager","extensions","pageExtensions","extensionsExpression","RegExp","join","fileReader","BatchedFileReader","DefaultFileReader","pathnameFilter","test","push","DevPagesRouteMatcherProvider","localeNormalizer","DevPagesAPIRouteMatcherProvider","ignorePartFilter","part","startsWith","isTurbopack","DevAppPageRouteMatcherProvider","DevAppRouteRouteMatcherProvider","getBuildId","prepareImpl","setGlobal","PHASE_DEVELOPMENT_SERVER","existingTelemetry","traceGlobals","get","telemetry","Telemetry","reload","interceptionRoutePatterns","getinterceptionRoutePatterns","isUnhandledRejectionListenerRegistered","registerUnhandledRejectionListener","on","err","logErrorWithOriginalStack","hasPage","normalizedPath","normalizePagePath","console","error","isMiddlewareFile","findPageFile","then","Boolean","appFile","pagesFile","runMiddleware","params","result","onWarning","warn","waitUntil","catch","DecodeError","MiddlewareNotFoundError","getProperError","decorateServerError","COMPILER_NAMES","edgeServer","request","response","parsedUrl","includes","finished","statusCode","renderError","runEdgeFunction","onError","req","res","getRequestHandler","handler","normalizeReq","normalizeRes","loggingConfig","logging","getRequestMeta","requestStart","hrtime","bigint","addRequestMeta","isMiddlewareRequest","originalResponse","once","routeMatch","requestEnd","logRequests","devRequestTimingInternalsEnd","manualTraceChild","hrtimeToEpochNanoseconds","path","handleRequest","span","traceAsyncFn","promise","memoryUsage","traceChild","String","rss","heapUsed","heapTotal","stop","run","basePath","originalPathname","pathHasPrefix","removePathPrefix","fs","existsSync","pathJoin","publicDir","PUBLIC_DIR_MIDDLEWARE_CONFLICT","formatServerError","sent","__NEXT_PAGE","isError","internalErr","body","send","type","getPagesManifest","NodeManifestLoader","serverDistDir","PAGES_MANIFEST","getAppPathsManifest","enabledDirectories","app","APP_PATHS_MANIFEST","rewrites","generateInterceptionRoutesRewrites","Object","keys","appPathRoutes","map","route","buildCustomRoute","regex","output","Log","exit","getMiddleware","middleware","getMiddlewareRouteMatcher","getNextFontManifest","hasMiddleware","actualMiddlewareFile","ensureMiddleware","loadInstrumentationModule","instrumentationModule","actualInstrumentationHookFile","getInstrumentationModule","message","runInstrumentationHookIfAvailable","ensureInstrumentationRegistered","ensureEdgeFunction","appPaths","generateRoutes","_dev","getStaticPaths","urlPathname","requestHeaders","isAppPath","__getStaticPaths","configFileName","httpAgentOptions","locales","defaultLocale","i18n","staticPathsWorker","pathsResult","loadStaticPaths","config","pprConfig","ppr","cacheComponents","cacheHandler","cacheHandlers","cacheLifeProfiles","cacheLife","fetchCacheKeyPrefix","isrFlushToDisk","nextConfigOutput","authInterrupts","useCacheTimeout","staticPageGenerationTimeout","sriEnabled","sri","algorithm","end","nextInvoke","withCoalescedInvoke","prerenderedRoutes","fallbackMode","fallback","some","item","FallbackMode","BLOCKING_STATIC_RENDER","PRERENDER","rawExistingManifest","promises","readFile","PRERENDER_MANIFEST","existingManifest","parse","staticPath","routes","fallbackPrerenderedRoute","find","dynamicRoutes","dataRoute","dataRouteRegex","fallbackModeToFallbackField","fallbackRevalidate","fallbackExpire","fallbackHeaders","fallbackStatus","fallbackRootParams","fallbackRouteParams","fallbackSourceRoute","prefetchDataRoute","prefetchDataRouteRegex","routeRegex","getRouteRegex","re","source","experimentalPPR","renderingMode","allowHeader","updatedManifest","writeFile","set","sendHmrMessage","HMR_MESSAGE_SENT_TO_BROWSER","STATIC_PARAMS_CHANGED","remove","opts","findPageComponents","locale","query","shouldEnsure","compilationErr","getCompilationError","WrappedBuildError","serverOptions","customServer","nextFontManifest","getFallbackErrorComponents","loadDefaultErrorComponents","instrumentationOnRequestError","args","silenceLog"],"mappings":";;;;+BAiIA;;;eAAqBA;;;6BAjHd;+DAQgB;2DACR;4BACQ;mCACc;yCACM;sBACV;2BACc;8BAClB;4BAOtB;oEACmC;mCACR;+BACJ;kCACG;yBACP;uBAMnB;wBACsB;8BACA;uBACyB;mCAClB;4CAI7B;wBAC8C;6DAChC;iEACmB;8BACe;wBACtB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