next 16.2.0-canary.1 → 16.2.0-canary.2

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.
Files changed (97) hide show
  1. package/dist/.build-commit +1 -1
  2. package/dist/bin/next +2 -2
  3. package/dist/build/define-env.js +1 -1
  4. package/dist/build/define-env.js.map +1 -1
  5. package/dist/build/index.js +3 -3
  6. package/dist/build/swc/index.js +1 -1
  7. package/dist/build/webpack-config.js +3 -3
  8. package/dist/bundle-analyzer/404.html +2 -2
  9. package/dist/bundle-analyzer/__next.__PAGE__.txt +1 -1
  10. package/dist/bundle-analyzer/__next._full.txt +1 -1
  11. package/dist/bundle-analyzer/__next._head.txt +1 -1
  12. package/dist/bundle-analyzer/__next._index.txt +1 -1
  13. package/dist/bundle-analyzer/__next._tree.txt +1 -1
  14. package/dist/bundle-analyzer/_not-found/__next._full.txt +1 -1
  15. package/dist/bundle-analyzer/_not-found/__next._head.txt +1 -1
  16. package/dist/bundle-analyzer/_not-found/__next._index.txt +1 -1
  17. package/dist/bundle-analyzer/_not-found/__next._not-found.__PAGE__.txt +1 -1
  18. package/dist/bundle-analyzer/_not-found/__next._not-found.txt +1 -1
  19. package/dist/bundle-analyzer/_not-found/__next._tree.txt +1 -1
  20. package/dist/bundle-analyzer/_not-found.html +2 -2
  21. package/dist/bundle-analyzer/_not-found.txt +1 -1
  22. package/dist/bundle-analyzer/index.html +2 -2
  23. package/dist/bundle-analyzer/index.txt +1 -1
  24. package/dist/client/app-bootstrap.js +1 -1
  25. package/dist/client/index.js +1 -1
  26. package/dist/compiled/next-devtools/index.js +1 -1
  27. package/dist/compiled/next-devtools/index.js.map +1 -1
  28. package/dist/compiled/next-server/pages-api.runtime.prod.js +1 -1
  29. package/dist/compiled/next-server/pages-api.runtime.prod.js.map +1 -1
  30. package/dist/compiled/next-server/pages.runtime.prod.js +1 -1
  31. package/dist/compiled/next-server/pages.runtime.prod.js.map +1 -1
  32. package/dist/compiled/next-server/server.runtime.prod.js +1 -1
  33. package/dist/compiled/next-server/server.runtime.prod.js.map +1 -1
  34. package/dist/esm/build/define-env.js +1 -1
  35. package/dist/esm/build/define-env.js.map +1 -1
  36. package/dist/esm/build/index.js +3 -3
  37. package/dist/esm/build/swc/index.js +1 -1
  38. package/dist/esm/build/webpack-config.js +3 -3
  39. package/dist/esm/client/app-bootstrap.js +1 -1
  40. package/dist/esm/client/index.js +1 -1
  41. package/dist/esm/next-devtools/shared/stack-frame.js +5 -5
  42. package/dist/esm/next-devtools/shared/stack-frame.js.map +1 -1
  43. package/dist/esm/next-devtools/shared/webpack-module-path.js +1 -1
  44. package/dist/esm/next-devtools/shared/webpack-module-path.js.map +1 -1
  45. package/dist/esm/server/config-schema.js +7 -0
  46. package/dist/esm/server/config-schema.js.map +1 -1
  47. package/dist/esm/server/config-shared.js.map +1 -1
  48. package/dist/esm/server/config.js +23 -6
  49. package/dist/esm/server/config.js.map +1 -1
  50. package/dist/esm/server/dev/browser-logs/receive-logs.js +1 -3
  51. package/dist/esm/server/dev/browser-logs/receive-logs.js.map +1 -1
  52. package/dist/esm/server/dev/browser-logs/source-map.js +1 -4
  53. package/dist/esm/server/dev/browser-logs/source-map.js.map +1 -1
  54. package/dist/esm/server/dev/hot-reloader-turbopack.js +4 -3
  55. package/dist/esm/server/dev/hot-reloader-turbopack.js.map +1 -1
  56. package/dist/esm/server/dev/hot-reloader-webpack.js +4 -3
  57. package/dist/esm/server/dev/hot-reloader-webpack.js.map +1 -1
  58. package/dist/esm/server/dev/middleware-webpack.js +2 -2
  59. package/dist/esm/server/dev/middleware-webpack.js.map +1 -1
  60. package/dist/esm/server/lib/app-info-log.js +1 -1
  61. package/dist/esm/server/lib/start-server.js +1 -1
  62. package/dist/esm/shared/lib/errors/canary-only-config-error.js +1 -1
  63. package/dist/next-devtools/dev-overlay/components/call-stack-frame/call-stack-frame.d.ts +1 -1
  64. package/dist/next-devtools/shared/stack-frame.d.ts +1 -1
  65. package/dist/next-devtools/shared/stack-frame.js +9 -9
  66. package/dist/next-devtools/shared/stack-frame.js.map +1 -1
  67. package/dist/next-devtools/shared/webpack-module-path.d.ts +1 -1
  68. package/dist/next-devtools/shared/webpack-module-path.js +4 -4
  69. package/dist/next-devtools/shared/webpack-module-path.js.map +1 -1
  70. package/dist/server/config-schema.js +7 -0
  71. package/dist/server/config-schema.js.map +1 -1
  72. package/dist/server/config-shared.d.ts +10 -0
  73. package/dist/server/config-shared.js.map +1 -1
  74. package/dist/server/config.js +23 -6
  75. package/dist/server/config.js.map +1 -1
  76. package/dist/server/dev/browser-logs/receive-logs.d.ts +1 -5
  77. package/dist/server/dev/browser-logs/receive-logs.js +1 -3
  78. package/dist/server/dev/browser-logs/receive-logs.js.map +1 -1
  79. package/dist/server/dev/browser-logs/source-map.d.ts +1 -4
  80. package/dist/server/dev/browser-logs/source-map.js +1 -4
  81. package/dist/server/dev/browser-logs/source-map.js.map +1 -1
  82. package/dist/server/dev/hot-reloader-turbopack.js +4 -3
  83. package/dist/server/dev/hot-reloader-turbopack.js.map +1 -1
  84. package/dist/server/dev/hot-reloader-webpack.js +4 -3
  85. package/dist/server/dev/hot-reloader-webpack.js.map +1 -1
  86. package/dist/server/dev/middleware-webpack.js +1 -1
  87. package/dist/server/dev/middleware-webpack.js.map +1 -1
  88. package/dist/server/lib/app-info-log.js +1 -1
  89. package/dist/server/lib/start-server.js +1 -1
  90. package/dist/shared/lib/errors/canary-only-config-error.js +1 -1
  91. package/dist/telemetry/anonymous-meta.js +1 -1
  92. package/dist/telemetry/events/session-stopped.js +2 -2
  93. package/dist/telemetry/events/version.js +2 -2
  94. package/package.json +15 -15
  95. /package/dist/bundle-analyzer/_next/static/{nf72XAMLkW3IWwd7evK6l → H1pZGGFy24tVYIk0cE8HL}/_buildManifest.js +0 -0
  96. /package/dist/bundle-analyzer/_next/static/{nf72XAMLkW3IWwd7evK6l → H1pZGGFy24tVYIk0cE8HL}/_clientMiddlewareManifest.json +0 -0
  97. /package/dist/bundle-analyzer/_next/static/{nf72XAMLkW3IWwd7evK6l → H1pZGGFy24tVYIk0cE8HL}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/server/dev/middleware-webpack.ts"],"sourcesContent":["import { findSourceMap, type SourceMap } from 'module'\nimport path from 'path'\nimport { fileURLToPath, pathToFileURL } from 'url'\nimport { SourceMapConsumer } from 'next/dist/compiled/source-map08'\nimport { getSourceMapFromFile } from './get-source-map-from-file'\nimport {\n devirtualizeReactServerURL,\n findApplicableSourceMapPayload,\n sourceMapIgnoreListsEverything,\n type BasicSourceMapPayload,\n type ModernSourceMapPayload,\n} from '../lib/source-maps'\nimport { openFileInEditor } from '../../next-devtools/server/launch-editor'\nimport {\n getOriginalCodeFrame,\n ignoreListAnonymousStackFramesIfSandwiched,\n type StackFrame,\n type IgnorableStackFrame,\n type OriginalStackFrameResponse,\n type OriginalStackFramesRequest,\n type OriginalStackFramesResponse,\n} from '../../next-devtools/server/shared'\nimport { middlewareResponse } from '../../next-devtools/server/middleware-response'\n\nimport type { IncomingMessage, ServerResponse } from 'http'\nimport type webpack from 'webpack'\nimport type {\n NullableMappedPosition,\n RawSourceMap,\n} from 'next/dist/compiled/source-map08'\nimport { formatFrameSourceFile } from '../../next-devtools/shared/webpack-module-path'\nimport type { MappedPosition } from 'source-map'\nimport { inspect } from 'util'\n\nfunction shouldIgnoreSource(sourceURL: string): boolean {\n return (\n sourceURL.includes('node_modules') ||\n // Only relevant for when Next.js is symlinked e.g. in the Next.js monorepo\n sourceURL.includes('next/dist') ||\n sourceURL.startsWith('node:')\n )\n}\n\ntype IgnoredSources = Array<{ url: string; ignored: boolean }>\n\ntype SourceAttributes = {\n sourcePosition: NullableMappedPosition\n sourceContent: string | null\n}\n\ntype Source =\n | {\n type: 'file'\n sourceMap: BasicSourceMapPayload\n ignoredSources: IgnoredSources\n moduleURL: string\n }\n | {\n type: 'bundle'\n sourceMap: BasicSourceMapPayload\n ignoredSources: IgnoredSources\n compilation: webpack.Compilation\n moduleId: string\n moduleURL: string\n }\n\nfunction getModuleById(\n id: string | undefined,\n compilation: webpack.Compilation\n) {\n const { chunkGraph, modules } = compilation\n\n return [...modules].find((module) => chunkGraph.getModuleId(module) === id)\n}\n\nfunction findModuleNotFoundFromError(errorMessage: string | undefined) {\n return errorMessage?.match(/'([^']+)' module/)?.[1]\n}\n\nfunction getSourcePath(source: string) {\n if (source.startsWith('file://')) {\n return fileURLToPath(source)\n }\n return source.replace(/^(webpack:\\/\\/\\/|webpack:\\/\\/|webpack:\\/\\/_N_E\\/)/, '')\n}\n\n/**\n * @returns 1-based lines and 0-based columns\n */\nasync function findOriginalSourcePositionAndContent(\n sourceMap: ModernSourceMapPayload,\n position: { line1: number | null; column1: number | null }\n): Promise<SourceAttributes | null> {\n let consumer: SourceMapConsumer\n try {\n consumer = await new SourceMapConsumer(sourceMap)\n } catch (cause) {\n console.error(\n new Error(\n `${sourceMap.file}: Invalid source map. Only conformant source maps can be used to find the original code.`,\n { cause }\n )\n )\n return null\n }\n\n try {\n const sourcePosition = consumer.originalPositionFor({\n line: position.line1 ?? 1,\n // 0-based columns out requires 0-based columns in.\n column: (position.column1 ?? 1) - 1,\n })\n\n if (!sourcePosition.source) {\n return null\n }\n\n const sourceContent: string | null =\n consumer.sourceContentFor(\n sourcePosition.source,\n /* returnNullOnMissing */ true\n ) ?? null\n\n return {\n sourcePosition,\n sourceContent,\n }\n } finally {\n consumer.destroy()\n }\n}\n\nexport function getIgnoredSources(\n sourceMap: RawSourceMap & { ignoreList?: number[] }\n): IgnoredSources {\n const ignoreList = new Set<number>(sourceMap.ignoreList ?? [])\n const moduleFilenames = sourceMap?.sources ?? []\n\n for (let index = 0; index < moduleFilenames.length; index++) {\n // bundlerFilePath case: webpack://./app/page.tsx\n const webpackSourceURL = moduleFilenames[index]\n // Format the path to the normal file path\n const formattedFilePath = formatFrameSourceFile(webpackSourceURL)\n if (shouldIgnoreSource(formattedFilePath)) {\n ignoreList.add(index)\n }\n }\n\n const ignoredSources = sourceMap.sources.map((source, index) => {\n return {\n url: source,\n ignored: ignoreList.has(sourceMap.sources.indexOf(source)),\n content: sourceMap.sourcesContent?.[index] ?? null,\n }\n })\n return ignoredSources\n}\n\nfunction isIgnoredSource(\n source: Source,\n sourcePosition: MappedPosition | NullableMappedPosition\n) {\n if (sourcePosition.source == null) {\n return true\n }\n for (const ignoredSource of source.ignoredSources) {\n if (ignoredSource.ignored && ignoredSource.url === sourcePosition.source) {\n return true\n }\n }\n\n return false\n}\n\nfunction findOriginalSourcePositionAndContentFromCompilation(\n moduleId: string | undefined,\n importedModule: string,\n compilation: webpack.Compilation\n): SourceAttributes | null {\n const module = getModuleById(moduleId, compilation)\n return module?.buildInfo?.importLocByPath?.get(importedModule) ?? null\n}\n\nexport async function createOriginalStackFrame({\n ignoredByDefault,\n source,\n rootDirectory,\n frame,\n errorMessage,\n}: {\n /** setting this to true will not consult ignoreList */\n ignoredByDefault: boolean\n source: Source\n rootDirectory: string\n frame: StackFrame\n errorMessage?: string\n}): Promise<OriginalStackFrameResponse | null> {\n const moduleNotFound = findModuleNotFoundFromError(errorMessage)\n const result = await (() => {\n if (moduleNotFound) {\n if (source.type === 'file') {\n return undefined\n }\n\n return findOriginalSourcePositionAndContentFromCompilation(\n source.moduleId,\n moduleNotFound,\n source.compilation\n )\n }\n return findOriginalSourcePositionAndContent(source.sourceMap, frame)\n })()\n\n if (!result) {\n return null\n }\n const { sourcePosition, sourceContent } = result\n\n if (!sourcePosition.source) {\n return null\n }\n\n const ignored =\n ignoredByDefault ||\n isIgnoredSource(source, sourcePosition) ||\n // If the source file is externals, should be excluded even it's not ignored source.\n // e.g. webpack://next/dist/.. needs to be ignored\n shouldIgnoreSource(source.moduleURL)\n\n const sourcePath = getSourcePath(\n // When sourcePosition.source is the loader path the modulePath is generally better.\n (sourcePosition.source!.includes('|')\n ? source.moduleURL\n : sourcePosition.source) || source.moduleURL\n )\n const filePath = path.resolve(rootDirectory, sourcePath)\n const resolvedFilePath = path.relative(rootDirectory, filePath)\n\n const traced: IgnorableStackFrame = {\n file: resolvedFilePath,\n line1: sourcePosition.line,\n column1: sourcePosition.column === null ? null : sourcePosition.column + 1,\n methodName:\n // We ignore the sourcemapped name since it won't be the correct name.\n // The callsite will point to the column of the variable name instead of the\n // name of the enclosing function.\n // TODO(NDX-531): Spy on prepareStackTrace to get the enclosing line number for method name mapping.\n // default is not a valid identifier in JS so webpack uses a custom variable when it's an unnamed default export\n // Resolve it back to `default` for the method name if the source position didn't have the method.\n frame.methodName\n ?.replace('__WEBPACK_DEFAULT_EXPORT__', 'default')\n ?.replace('__webpack_exports__.', ''),\n arguments: [],\n ignored,\n }\n\n return {\n originalStackFrame: traced,\n originalCodeFrame: getOriginalCodeFrame(traced, sourceContent),\n }\n}\n\nasync function getSourceMapFromCompilation(\n id: string,\n compilation: webpack.Compilation\n): Promise<RawSourceMap | undefined> {\n try {\n const module = getModuleById(id, compilation)\n\n if (!module) {\n return undefined\n }\n\n // @ts-expect-error The types for `CodeGenerationResults.get` require a\n // runtime to be passed as second argument, but apparently it also works\n // without it.\n const codeGenerationResult = compilation.codeGenerationResults.get(module)\n const source = codeGenerationResult?.sources.get('javascript')\n\n return source?.map() ?? undefined\n } catch (err) {\n console.error(`Failed to lookup module by ID (\"${id}\"):`, err)\n return undefined\n }\n}\n\nasync function getSource(\n frame: {\n file: string | null\n line1: number | null\n column1: number | null\n },\n options: {\n getCompilations: () => webpack.Compilation[]\n }\n): Promise<Source | undefined> {\n let sourceURL = frame.file ?? ''\n const { getCompilations } = options\n\n sourceURL = devirtualizeReactServerURL(sourceURL)\n\n let nativeSourceMap: SourceMap | undefined\n try {\n nativeSourceMap = findSourceMap(sourceURL)\n } catch (cause) {\n throw new Error(\n `${sourceURL}: Invalid source map. Only conformant source maps can be used to find the original code.`,\n { cause }\n )\n }\n\n if (nativeSourceMap !== undefined) {\n const sourceMapPayload = nativeSourceMap.payload\n return {\n type: 'file',\n sourceMap: findApplicableSourceMapPayload(\n (frame.line1 ?? 1) - 1,\n (frame.column1 ?? 1) - 1,\n sourceMapPayload\n )!,\n\n ignoredSources: getIgnoredSources(\n // @ts-expect-error -- TODO: Support IndexSourceMap\n sourceMapPayload\n ),\n moduleURL: sourceURL,\n }\n }\n\n if (path.isAbsolute(sourceURL)) {\n sourceURL = pathToFileURL(sourceURL).href\n }\n\n if (sourceURL.startsWith('file:')) {\n const sourceMap = await getSourceMapFromFile(sourceURL)\n return sourceMap\n ? {\n type: 'file',\n sourceMap,\n ignoredSources: getIgnoredSources(sourceMap),\n moduleURL: sourceURL,\n }\n : undefined\n }\n\n // webpack-internal:///./src/hello.tsx => ./src/hello.tsx\n // webpack://_N_E/./src/hello.tsx => ./src/hello.tsx\n const moduleId = sourceURL\n .replace(/^(webpack-internal:\\/\\/\\/|webpack:\\/\\/(_N_E\\/)?)/, '')\n .replace(/\\?\\d+$/, '')\n\n // (rsc)/./src/hello.tsx => ./src/hello.tsx\n const moduleURL = moduleId.replace(/^(\\(.*\\)\\/?)/, '')\n\n for (const compilation of getCompilations()) {\n const sourceMap = await getSourceMapFromCompilation(moduleId, compilation)\n\n if (sourceMap) {\n const ignoredSources = getIgnoredSources(sourceMap)\n return {\n type: 'bundle',\n sourceMap,\n compilation,\n moduleId,\n moduleURL,\n ignoredSources,\n }\n }\n }\n\n return undefined\n}\n\nexport async function getOriginalStackFrames({\n isServer,\n isEdgeServer,\n isAppDirectory,\n frames,\n clientStats,\n serverStats,\n edgeServerStats,\n rootDirectory,\n}: {\n isServer: boolean\n isEdgeServer: boolean\n isAppDirectory: boolean\n frames: readonly StackFrame[]\n clientStats: () => webpack.Stats | null\n serverStats: () => webpack.Stats | null\n edgeServerStats: () => webpack.Stats | null\n rootDirectory: string\n}): Promise<OriginalStackFramesResponse> {\n const frameResponses = await Promise.all(\n frames.map(\n (frame): Promise<OriginalStackFramesResponse[number]> =>\n getOriginalStackFrame({\n isServer,\n isEdgeServer,\n isAppDirectory,\n frame,\n clientStats,\n serverStats,\n edgeServerStats,\n rootDirectory,\n }).then(\n (value) => {\n return {\n status: 'fulfilled',\n value,\n }\n },\n (reason) => {\n return {\n status: 'rejected',\n reason: inspect(reason, { colors: false }),\n }\n }\n )\n )\n )\n\n ignoreListAnonymousStackFramesIfSandwiched(frameResponses)\n\n return frameResponses\n}\n\nasync function getOriginalStackFrame({\n isServer,\n isEdgeServer,\n isAppDirectory,\n frame,\n clientStats,\n serverStats,\n edgeServerStats,\n rootDirectory,\n}: {\n isServer: boolean\n isEdgeServer: boolean\n isAppDirectory: boolean\n frame: StackFrame\n clientStats: () => webpack.Stats | null\n serverStats: () => webpack.Stats | null\n edgeServerStats: () => webpack.Stats | null\n rootDirectory: string\n}): Promise<OriginalStackFrameResponse> {\n const filename = frame.file ?? ''\n const source = await getSource(frame, {\n getCompilations: () => {\n const compilations: webpack.Compilation[] = []\n\n // Try Client Compilation first. In `pages` we leverage\n // `isClientError` to check. In `app` it depends on if it's a server\n // / client component and when the code throws. E.g. during HTML\n // rendering it's the server/edge compilation.\n if ((!isEdgeServer && !isServer) || isAppDirectory) {\n const compilation = clientStats()?.compilation\n\n if (compilation) {\n compilations.push(compilation)\n }\n }\n\n // Try Server Compilation. In `pages` this could be something\n // imported in getServerSideProps/getStaticProps as the code for\n // those is tree-shaken. In `app` this finds server components and\n // code that was imported from a server component. It also covers\n // when client component code throws during HTML rendering.\n if (isServer || isAppDirectory) {\n const compilation = serverStats()?.compilation\n\n if (compilation) {\n compilations.push(compilation)\n }\n }\n\n // Try Edge Server Compilation. Both cases are the same as Server\n // Compilation, main difference is that it covers `runtime: 'edge'`\n // pages/app routes.\n if (isEdgeServer || isAppDirectory) {\n const compilation = edgeServerStats()?.compilation\n\n if (compilation) {\n compilations.push(compilation)\n }\n }\n\n return compilations\n },\n })\n\n let defaultNormalizedStackFrameLocation = frame.file\n if (\n defaultNormalizedStackFrameLocation !== null &&\n defaultNormalizedStackFrameLocation.startsWith('file://')\n ) {\n defaultNormalizedStackFrameLocation = path.relative(\n rootDirectory,\n fileURLToPath(defaultNormalizedStackFrameLocation)\n )\n }\n // This stack frame is used for the one that couldn't locate the source or source mapped frame\n const defaultStackFrame: IgnorableStackFrame = {\n file: defaultNormalizedStackFrameLocation,\n line1: frame.line1,\n column1: frame.column1,\n methodName: frame.methodName,\n ignored: shouldIgnoreSource(filename),\n arguments: [],\n }\n if (!source) {\n // return original stack frame with no source map\n return {\n originalStackFrame: defaultStackFrame,\n originalCodeFrame: null,\n }\n }\n defaultStackFrame.ignored ||= sourceMapIgnoreListsEverything(source.sourceMap)\n\n const originalStackFrameResponse = await createOriginalStackFrame({\n ignoredByDefault: defaultStackFrame.ignored,\n frame,\n source,\n rootDirectory,\n })\n\n if (!originalStackFrameResponse) {\n return {\n originalStackFrame: defaultStackFrame,\n originalCodeFrame: null,\n }\n }\n\n return originalStackFrameResponse\n}\n\nexport function getOverlayMiddleware(options: {\n rootDirectory: string\n isSrcDir: boolean\n clientStats: () => webpack.Stats | null\n serverStats: () => webpack.Stats | null\n edgeServerStats: () => webpack.Stats | null\n}) {\n const { rootDirectory, isSrcDir, clientStats, serverStats, edgeServerStats } =\n options\n\n return async function (\n req: IncomingMessage,\n res: ServerResponse,\n next: () => void\n ): Promise<void> {\n const { pathname, searchParams } = new URL(`http://n${req.url}`)\n\n if (pathname === '/__nextjs_original-stack-frames') {\n if (req.method !== 'POST') {\n return middlewareResponse.badRequest(res)\n }\n\n const body = await new Promise<string>((resolve, reject) => {\n let data = ''\n req.on('data', (chunk) => {\n data += chunk\n })\n req.on('end', () => resolve(data))\n req.on('error', reject)\n })\n\n try {\n const { frames, isServer, isEdgeServer, isAppDirectory } = JSON.parse(\n body\n ) as OriginalStackFramesRequest\n\n return middlewareResponse.json(\n res,\n await getOriginalStackFrames({\n isServer,\n isEdgeServer,\n isAppDirectory,\n frames,\n clientStats,\n serverStats,\n edgeServerStats,\n rootDirectory,\n })\n )\n } catch (err) {\n return middlewareResponse.badRequest(res)\n }\n } else if (pathname === '/__nextjs_launch-editor') {\n const frame = {\n file: searchParams.get('file') as string,\n methodName: searchParams.get('methodName') as string,\n line1: parseInt(searchParams.get('line1') ?? '1', 10) || 1,\n column1: parseInt(searchParams.get('column1') ?? '1', 10) || 1,\n arguments: searchParams.getAll('arguments').filter(Boolean),\n } satisfies StackFrame\n\n if (!frame.file) return middlewareResponse.badRequest(res)\n\n let openEditorResult\n const isAppRelativePath = searchParams.get('isAppRelativePath') === '1'\n if (isAppRelativePath) {\n const relativeFilePath = searchParams.get('file') || ''\n const appPath = path.join(\n 'app',\n isSrcDir ? 'src' : '',\n relativeFilePath\n )\n openEditorResult = await openFileInEditor(appPath, 1, 1, rootDirectory)\n } else {\n // TODO: How do we differentiate layers and actual file paths with round brackets?\n // frame files may start with their webpack layer, like (middleware)/middleware.js\n const filePath = frame.file.replace(/^\\([^)]+\\)\\//, '')\n openEditorResult = await openFileInEditor(\n filePath,\n frame.line1,\n frame.column1 ?? 1,\n rootDirectory\n )\n }\n if (openEditorResult.error) {\n console.error('Failed to launch editor:', openEditorResult.error)\n return middlewareResponse.internalServerError(\n res,\n openEditorResult.error\n )\n }\n if (!openEditorResult.found) {\n return middlewareResponse.notFound(res)\n }\n return middlewareResponse.noContent(res)\n }\n\n return next()\n }\n}\n\nexport function getSourceMapMiddleware(options: {\n clientStats: () => webpack.Stats | null\n serverStats: () => webpack.Stats | null\n edgeServerStats: () => webpack.Stats | null\n}) {\n const { clientStats, serverStats, edgeServerStats } = options\n\n return async function (\n req: IncomingMessage,\n res: ServerResponse,\n next: () => void\n ): Promise<void> {\n const { pathname, searchParams } = new URL(`http://n${req.url}`)\n\n if (pathname !== '/__nextjs_source-map') {\n return next()\n }\n\n const filename = searchParams.get('filename')\n\n if (!filename) {\n return middlewareResponse.badRequest(res)\n }\n\n let source: Source | undefined\n\n try {\n source = await getSource(\n {\n file: filename,\n // Webpack doesn't use Index Source Maps\n line1: null,\n column1: null,\n },\n {\n getCompilations: () => {\n const compilations: webpack.Compilation[] = []\n\n for (const stats of [\n clientStats(),\n serverStats(),\n edgeServerStats(),\n ]) {\n if (stats?.compilation) {\n compilations.push(stats.compilation)\n }\n }\n\n return compilations\n },\n }\n )\n } catch (error) {\n return middlewareResponse.internalServerError(res, error)\n }\n\n if (!source) {\n return middlewareResponse.noContent(res)\n }\n\n return middlewareResponse.json(res, source.sourceMap)\n }\n}\n"],"names":["findSourceMap","path","fileURLToPath","pathToFileURL","SourceMapConsumer","getSourceMapFromFile","devirtualizeReactServerURL","findApplicableSourceMapPayload","sourceMapIgnoreListsEverything","openFileInEditor","getOriginalCodeFrame","ignoreListAnonymousStackFramesIfSandwiched","middlewareResponse","formatFrameSourceFile","inspect","shouldIgnoreSource","sourceURL","includes","startsWith","getModuleById","id","compilation","chunkGraph","modules","find","module","getModuleId","findModuleNotFoundFromError","errorMessage","match","getSourcePath","source","replace","findOriginalSourcePositionAndContent","sourceMap","position","consumer","cause","console","error","Error","file","sourcePosition","originalPositionFor","line","line1","column","column1","sourceContent","sourceContentFor","destroy","getIgnoredSources","ignoreList","Set","moduleFilenames","sources","index","length","webpackSourceURL","formattedFilePath","add","ignoredSources","map","url","ignored","has","indexOf","content","sourcesContent","isIgnoredSource","ignoredSource","findOriginalSourcePositionAndContentFromCompilation","moduleId","importedModule","buildInfo","importLocByPath","get","createOriginalStackFrame","ignoredByDefault","rootDirectory","frame","moduleNotFound","result","type","undefined","moduleURL","sourcePath","filePath","resolve","resolvedFilePath","relative","traced","methodName","arguments","originalStackFrame","originalCodeFrame","getSourceMapFromCompilation","codeGenerationResult","codeGenerationResults","err","getSource","options","getCompilations","nativeSourceMap","sourceMapPayload","payload","isAbsolute","href","getOriginalStackFrames","isServer","isEdgeServer","isAppDirectory","frames","clientStats","serverStats","edgeServerStats","frameResponses","Promise","all","getOriginalStackFrame","then","value","status","reason","colors","filename","compilations","push","defaultNormalizedStackFrameLocation","defaultStackFrame","originalStackFrameResponse","getOverlayMiddleware","isSrcDir","req","res","next","pathname","searchParams","URL","method","badRequest","body","reject","data","on","chunk","JSON","parse","json","parseInt","getAll","filter","Boolean","openEditorResult","isAppRelativePath","relativeFilePath","appPath","join","internalServerError","found","notFound","noContent","getSourceMapMiddleware","stats"],"mappings":"AAAA,SAASA,aAAa,QAAwB,SAAQ;AACtD,OAAOC,UAAU,OAAM;AACvB,SAASC,aAAa,EAAEC,aAAa,QAAQ,MAAK;AAClD,SAASC,iBAAiB,QAAQ,kCAAiC;AACnE,SAASC,oBAAoB,QAAQ,6BAA4B;AACjE,SACEC,0BAA0B,EAC1BC,8BAA8B,EAC9BC,8BAA8B,QAGzB,qBAAoB;AAC3B,SAASC,gBAAgB,QAAQ,2CAA0C;AAC3E,SACEC,oBAAoB,EACpBC,0CAA0C,QAMrC,oCAAmC;AAC1C,SAASC,kBAAkB,QAAQ,iDAAgD;AAQnF,SAASC,qBAAqB,QAAQ,iDAAgD;AAEtF,SAASC,OAAO,QAAQ,OAAM;AAE9B,SAASC,mBAAmBC,SAAiB;IAC3C,OACEA,UAAUC,QAAQ,CAAC,mBACnB,2EAA2E;IAC3ED,UAAUC,QAAQ,CAAC,gBACnBD,UAAUE,UAAU,CAAC;AAEzB;AAyBA,SAASC,cACPC,EAAsB,EACtBC,WAAgC;IAEhC,MAAM,EAAEC,UAAU,EAAEC,OAAO,EAAE,GAAGF;IAEhC,OAAO;WAAIE;KAAQ,CAACC,IAAI,CAAC,CAACC,SAAWH,WAAWI,WAAW,CAACD,YAAYL;AAC1E;AAEA,SAASO,4BAA4BC,YAAgC;QAC5DA;IAAP,OAAOA,iCAAAA,sBAAAA,aAAcC,KAAK,CAAC,wCAApBD,mBAAyC,CAAC,EAAE;AACrD;AAEA,SAASE,cAAcC,MAAc;IACnC,IAAIA,OAAOb,UAAU,CAAC,YAAY;QAChC,OAAOhB,cAAc6B;IACvB;IACA,OAAOA,OAAOC,OAAO,CAAC,qDAAqD;AAC7E;AAEA;;CAEC,GACD,eAAeC,qCACbC,SAAiC,EACjCC,QAA0D;IAE1D,IAAIC;IACJ,I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BACN,wCAAwC;gBACxChF,OAAO;gBACPE,SAAS;YACX,GACA;gBACEuD,iBAAiB;oBACf,MAAMwB,eAAsC,EAAE;oBAE9C,KAAK,MAAMqC,SAAS;wBAClBlD;wBACAC;wBACAC;qBACD,CAAE;wBACD,IAAIgD,yBAAAA,MAAO9I,WAAW,EAAE;4BACtByG,aAAaC,IAAI,CAACoC,MAAM9I,WAAW;wBACrC;oBACF;oBAEA,OAAOyG;gBACT;YACF;QAEJ,EAAE,OAAOvF,OAAO;YACd,OAAO3B,mBAAmBkJ,mBAAmB,CAACxB,KAAK/F;QACrD;QAEA,IAAI,CAACR,QAAQ;YACX,OAAOnB,mBAAmBqJ,SAAS,CAAC3B;QACtC;QAEA,OAAO1H,mBAAmBwI,IAAI,CAACd,KAAKvG,OAAOG,SAAS;IACtD;AACF","ignoreList":[0]}
1
+ {"version":3,"sources":["../../../../src/server/dev/middleware-webpack.ts"],"sourcesContent":["import { findSourceMap, type SourceMap } from 'module'\nimport path from 'path'\nimport { fileURLToPath, pathToFileURL } from 'url'\nimport { SourceMapConsumer } from 'next/dist/compiled/source-map08'\nimport { getSourceMapFromFile } from './get-source-map-from-file'\nimport {\n devirtualizeReactServerURL,\n findApplicableSourceMapPayload,\n sourceMapIgnoreListsEverything,\n type BasicSourceMapPayload,\n type ModernSourceMapPayload,\n} from '../lib/source-maps'\nimport { openFileInEditor } from '../../next-devtools/server/launch-editor'\nimport {\n getOriginalCodeFrame,\n ignoreListAnonymousStackFramesIfSandwiched,\n type StackFrame,\n type IgnorableStackFrame,\n type OriginalStackFrameResponse,\n type OriginalStackFramesRequest,\n type OriginalStackFramesResponse,\n} from '../../next-devtools/server/shared'\nimport { middlewareResponse } from '../../next-devtools/server/middleware-response'\n\nimport type { IncomingMessage, ServerResponse } from 'http'\nimport type webpack from 'webpack'\nimport type {\n NullableMappedPosition,\n RawSourceMap,\n} from 'next/dist/compiled/source-map08'\nimport { formatStackFrameFile } from '../../next-devtools/shared/webpack-module-path'\nimport type { MappedPosition } from 'source-map'\nimport { inspect } from 'util'\n\nfunction shouldIgnoreSource(sourceURL: string): boolean {\n return (\n sourceURL.includes('node_modules') ||\n // Only relevant for when Next.js is symlinked e.g. in the Next.js monorepo\n sourceURL.includes('next/dist') ||\n sourceURL.startsWith('node:')\n )\n}\n\ntype IgnoredSources = Array<{ url: string; ignored: boolean }>\n\ntype SourceAttributes = {\n sourcePosition: NullableMappedPosition\n sourceContent: string | null\n}\n\ntype Source =\n | {\n type: 'file'\n sourceMap: BasicSourceMapPayload\n ignoredSources: IgnoredSources\n moduleURL: string\n }\n | {\n type: 'bundle'\n sourceMap: BasicSourceMapPayload\n ignoredSources: IgnoredSources\n compilation: webpack.Compilation\n moduleId: string\n moduleURL: string\n }\n\nfunction getModuleById(\n id: string | undefined,\n compilation: webpack.Compilation\n) {\n const { chunkGraph, modules } = compilation\n\n return [...modules].find((module) => chunkGraph.getModuleId(module) === id)\n}\n\nfunction findModuleNotFoundFromError(errorMessage: string | undefined) {\n return errorMessage?.match(/'([^']+)' module/)?.[1]\n}\n\nfunction getSourcePath(source: string) {\n if (source.startsWith('file://')) {\n return fileURLToPath(source)\n }\n return source.replace(/^(webpack:\\/\\/\\/|webpack:\\/\\/|webpack:\\/\\/_N_E\\/)/, '')\n}\n\n/**\n * @returns 1-based lines and 0-based columns\n */\nasync function findOriginalSourcePositionAndContent(\n sourceMap: ModernSourceMapPayload,\n position: { line1: number | null; column1: number | null }\n): Promise<SourceAttributes | null> {\n let consumer: SourceMapConsumer\n try {\n consumer = await new SourceMapConsumer(sourceMap)\n } catch (cause) {\n console.error(\n new Error(\n `${sourceMap.file}: Invalid source map. Only conformant source maps can be used to find the original code.`,\n { cause }\n )\n )\n return null\n }\n\n try {\n const sourcePosition = consumer.originalPositionFor({\n line: position.line1 ?? 1,\n // 0-based columns out requires 0-based columns in.\n column: (position.column1 ?? 1) - 1,\n })\n\n if (!sourcePosition.source) {\n return null\n }\n\n const sourceContent: string | null =\n consumer.sourceContentFor(\n sourcePosition.source,\n /* returnNullOnMissing */ true\n ) ?? null\n\n return {\n sourcePosition,\n sourceContent,\n }\n } finally {\n consumer.destroy()\n }\n}\n\nexport function getIgnoredSources(\n sourceMap: RawSourceMap & { ignoreList?: number[] }\n): IgnoredSources {\n const ignoreList = new Set<number>(sourceMap.ignoreList ?? [])\n const moduleFilenames = sourceMap?.sources ?? []\n\n for (let index = 0; index < moduleFilenames.length; index++) {\n // bundlerFilePath case: webpack://./app/page.tsx\n const webpackSourceURL = moduleFilenames[index]\n // Format the path to the normal file path\n const formattedFilePath = formatStackFrameFile(webpackSourceURL)\n if (shouldIgnoreSource(formattedFilePath)) {\n ignoreList.add(index)\n }\n }\n\n const ignoredSources = sourceMap.sources.map((source, index) => {\n return {\n url: source,\n ignored: ignoreList.has(sourceMap.sources.indexOf(source)),\n content: sourceMap.sourcesContent?.[index] ?? null,\n }\n })\n return ignoredSources\n}\n\nfunction isIgnoredSource(\n source: Source,\n sourcePosition: MappedPosition | NullableMappedPosition\n) {\n if (sourcePosition.source == null) {\n return true\n }\n for (const ignoredSource of source.ignoredSources) {\n if (ignoredSource.ignored && ignoredSource.url === sourcePosition.source) {\n return true\n }\n }\n\n return false\n}\n\nfunction findOriginalSourcePositionAndContentFromCompilation(\n moduleId: string | undefined,\n importedModule: string,\n compilation: webpack.Compilation\n): SourceAttributes | null {\n const module = getModuleById(moduleId, compilation)\n return module?.buildInfo?.importLocByPath?.get(importedModule) ?? null\n}\n\nexport async function createOriginalStackFrame({\n ignoredByDefault,\n source,\n rootDirectory,\n frame,\n errorMessage,\n}: {\n /** setting this to true will not consult ignoreList */\n ignoredByDefault: boolean\n source: Source\n rootDirectory: string\n frame: StackFrame\n errorMessage?: string\n}): Promise<OriginalStackFrameResponse | null> {\n const moduleNotFound = findModuleNotFoundFromError(errorMessage)\n const result = await (() => {\n if (moduleNotFound) {\n if (source.type === 'file') {\n return undefined\n }\n\n return findOriginalSourcePositionAndContentFromCompilation(\n source.moduleId,\n moduleNotFound,\n source.compilation\n )\n }\n return findOriginalSourcePositionAndContent(source.sourceMap, frame)\n })()\n\n if (!result) {\n return null\n }\n const { sourcePosition, sourceContent } = result\n\n if (!sourcePosition.source) {\n return null\n }\n\n const ignored =\n ignoredByDefault ||\n isIgnoredSource(source, sourcePosition) ||\n // If the source file is externals, should be excluded even it's not ignored source.\n // e.g. webpack://next/dist/.. needs to be ignored\n shouldIgnoreSource(source.moduleURL)\n\n const sourcePath = getSourcePath(\n // When sourcePosition.source is the loader path the modulePath is generally better.\n (sourcePosition.source!.includes('|')\n ? source.moduleURL\n : sourcePosition.source) || source.moduleURL\n )\n const filePath = path.resolve(rootDirectory, sourcePath)\n const resolvedFilePath = path.relative(rootDirectory, filePath)\n\n const traced: IgnorableStackFrame = {\n file: resolvedFilePath,\n line1: sourcePosition.line,\n column1: sourcePosition.column === null ? null : sourcePosition.column + 1,\n methodName:\n // We ignore the sourcemapped name since it won't be the correct name.\n // The callsite will point to the column of the variable name instead of the\n // name of the enclosing function.\n // TODO(NDX-531): Spy on prepareStackTrace to get the enclosing line number for method name mapping.\n // default is not a valid identifier in JS so webpack uses a custom variable when it's an unnamed default export\n // Resolve it back to `default` for the method name if the source position didn't have the method.\n frame.methodName\n ?.replace('__WEBPACK_DEFAULT_EXPORT__', 'default')\n ?.replace('__webpack_exports__.', ''),\n arguments: [],\n ignored,\n }\n\n return {\n originalStackFrame: traced,\n originalCodeFrame: getOriginalCodeFrame(traced, sourceContent),\n }\n}\n\nasync function getSourceMapFromCompilation(\n id: string,\n compilation: webpack.Compilation\n): Promise<RawSourceMap | undefined> {\n try {\n const module = getModuleById(id, compilation)\n\n if (!module) {\n return undefined\n }\n\n // @ts-expect-error The types for `CodeGenerationResults.get` require a\n // runtime to be passed as second argument, but apparently it also works\n // without it.\n const codeGenerationResult = compilation.codeGenerationResults.get(module)\n const source = codeGenerationResult?.sources.get('javascript')\n\n return source?.map() ?? undefined\n } catch (err) {\n console.error(`Failed to lookup module by ID (\"${id}\"):`, err)\n return undefined\n }\n}\n\nasync function getSource(\n frame: {\n file: string | null\n line1: number | null\n column1: number | null\n },\n options: {\n getCompilations: () => webpack.Compilation[]\n }\n): Promise<Source | undefined> {\n let sourceURL = frame.file ?? ''\n const { getCompilations } = options\n\n sourceURL = devirtualizeReactServerURL(sourceURL)\n\n let nativeSourceMap: SourceMap | undefined\n try {\n nativeSourceMap = findSourceMap(sourceURL)\n } catch (cause) {\n throw new Error(\n `${sourceURL}: Invalid source map. Only conformant source maps can be used to find the original code.`,\n { cause }\n )\n }\n\n if (nativeSourceMap !== undefined) {\n const sourceMapPayload = nativeSourceMap.payload\n return {\n type: 'file',\n sourceMap: findApplicableSourceMapPayload(\n (frame.line1 ?? 1) - 1,\n (frame.column1 ?? 1) - 1,\n sourceMapPayload\n )!,\n\n ignoredSources: getIgnoredSources(\n // @ts-expect-error -- TODO: Support IndexSourceMap\n sourceMapPayload\n ),\n moduleURL: sourceURL,\n }\n }\n\n if (path.isAbsolute(sourceURL)) {\n sourceURL = pathToFileURL(sourceURL).href\n }\n\n if (sourceURL.startsWith('file:')) {\n const sourceMap = await getSourceMapFromFile(sourceURL)\n return sourceMap\n ? {\n type: 'file',\n sourceMap,\n ignoredSources: getIgnoredSources(sourceMap),\n moduleURL: sourceURL,\n }\n : undefined\n }\n\n // webpack-internal:///./src/hello.tsx => ./src/hello.tsx\n // webpack://_N_E/./src/hello.tsx => ./src/hello.tsx\n const moduleId = sourceURL\n .replace(/^(webpack-internal:\\/\\/\\/|webpack:\\/\\/(_N_E\\/)?)/, '')\n .replace(/\\?\\d+$/, '')\n\n // (rsc)/./src/hello.tsx => ./src/hello.tsx\n const moduleURL = moduleId.replace(/^(\\(.*\\)\\/?)/, '')\n\n for (const compilation of getCompilations()) {\n const sourceMap = await getSourceMapFromCompilation(moduleId, compilation)\n\n if (sourceMap) {\n const ignoredSources = getIgnoredSources(sourceMap)\n return {\n type: 'bundle',\n sourceMap,\n compilation,\n moduleId,\n moduleURL,\n ignoredSources,\n }\n }\n }\n\n return undefined\n}\n\nexport async function getOriginalStackFrames({\n isServer,\n isEdgeServer,\n isAppDirectory,\n frames,\n clientStats,\n serverStats,\n edgeServerStats,\n rootDirectory,\n}: {\n isServer: boolean\n isEdgeServer: boolean\n isAppDirectory: boolean\n frames: readonly StackFrame[]\n clientStats: () => webpack.Stats | null\n serverStats: () => webpack.Stats | null\n edgeServerStats: () => webpack.Stats | null\n rootDirectory: string\n}): Promise<OriginalStackFramesResponse> {\n const frameResponses = await Promise.all(\n frames.map(\n (frame): Promise<OriginalStackFramesResponse[number]> =>\n getOriginalStackFrame({\n isServer,\n isEdgeServer,\n isAppDirectory,\n frame,\n clientStats,\n serverStats,\n edgeServerStats,\n rootDirectory,\n }).then(\n (value) => {\n return {\n status: 'fulfilled',\n value,\n }\n },\n (reason) => {\n return {\n status: 'rejected',\n reason: inspect(reason, { colors: false }),\n }\n }\n )\n )\n )\n\n ignoreListAnonymousStackFramesIfSandwiched(frameResponses)\n\n return frameResponses\n}\n\nasync function getOriginalStackFrame({\n isServer,\n isEdgeServer,\n isAppDirectory,\n frame,\n clientStats,\n serverStats,\n edgeServerStats,\n rootDirectory,\n}: {\n isServer: boolean\n isEdgeServer: boolean\n isAppDirectory: boolean\n frame: StackFrame\n clientStats: () => webpack.Stats | null\n serverStats: () => webpack.Stats | null\n edgeServerStats: () => webpack.Stats | null\n rootDirectory: string\n}): Promise<OriginalStackFrameResponse> {\n const filename = frame.file ?? ''\n const source = await getSource(frame, {\n getCompilations: () => {\n const compilations: webpack.Compilation[] = []\n\n // Try Client Compilation first. In `pages` we leverage\n // `isClientError` to check. In `app` it depends on if it's a server\n // / client component and when the code throws. E.g. during HTML\n // rendering it's the server/edge compilation.\n if ((!isEdgeServer && !isServer) || isAppDirectory) {\n const compilation = clientStats()?.compilation\n\n if (compilation) {\n compilations.push(compilation)\n }\n }\n\n // Try Server Compilation. In `pages` this could be something\n // imported in getServerSideProps/getStaticProps as the code for\n // those is tree-shaken. In `app` this finds server components and\n // code that was imported from a server component. It also covers\n // when client component code throws during HTML rendering.\n if (isServer || isAppDirectory) {\n const compilation = serverStats()?.compilation\n\n if (compilation) {\n compilations.push(compilation)\n }\n }\n\n // Try Edge Server Compilation. Both cases are the same as Server\n // Compilation, main difference is that it covers `runtime: 'edge'`\n // pages/app routes.\n if (isEdgeServer || isAppDirectory) {\n const compilation = edgeServerStats()?.compilation\n\n if (compilation) {\n compilations.push(compilation)\n }\n }\n\n return compilations\n },\n })\n\n let defaultNormalizedStackFrameLocation = frame.file\n if (\n defaultNormalizedStackFrameLocation !== null &&\n defaultNormalizedStackFrameLocation.startsWith('file://')\n ) {\n defaultNormalizedStackFrameLocation = path.relative(\n rootDirectory,\n fileURLToPath(defaultNormalizedStackFrameLocation)\n )\n }\n // This stack frame is used for the one that couldn't locate the source or source mapped frame\n const defaultStackFrame: IgnorableStackFrame = {\n file: defaultNormalizedStackFrameLocation,\n line1: frame.line1,\n column1: frame.column1,\n methodName: frame.methodName,\n ignored: shouldIgnoreSource(filename),\n arguments: [],\n }\n if (!source) {\n // return original stack frame with no source map\n return {\n originalStackFrame: defaultStackFrame,\n originalCodeFrame: null,\n }\n }\n defaultStackFrame.ignored ||= sourceMapIgnoreListsEverything(source.sourceMap)\n\n const originalStackFrameResponse = await createOriginalStackFrame({\n ignoredByDefault: defaultStackFrame.ignored,\n frame,\n source,\n rootDirectory,\n })\n\n if (!originalStackFrameResponse) {\n return {\n originalStackFrame: defaultStackFrame,\n originalCodeFrame: null,\n }\n }\n\n return originalStackFrameResponse\n}\n\nexport function getOverlayMiddleware(options: {\n rootDirectory: string\n isSrcDir: boolean\n clientStats: () => webpack.Stats | null\n serverStats: () => webpack.Stats | null\n edgeServerStats: () => webpack.Stats | null\n}) {\n const { rootDirectory, isSrcDir, clientStats, serverStats, edgeServerStats } =\n options\n\n return async function (\n req: IncomingMessage,\n res: ServerResponse,\n next: () => void\n ): Promise<void> {\n const { pathname, searchParams } = new URL(`http://n${req.url}`)\n\n if (pathname === '/__nextjs_original-stack-frames') {\n if (req.method !== 'POST') {\n return middlewareResponse.badRequest(res)\n }\n\n const body = await new Promise<string>((resolve, reject) => {\n let data = ''\n req.on('data', (chunk) => {\n data += chunk\n })\n req.on('end', () => resolve(data))\n req.on('error', reject)\n })\n\n try {\n const { frames, isServer, isEdgeServer, isAppDirectory } = JSON.parse(\n body\n ) as OriginalStackFramesRequest\n\n return middlewareResponse.json(\n res,\n await getOriginalStackFrames({\n isServer,\n isEdgeServer,\n isAppDirectory,\n frames,\n clientStats,\n serverStats,\n edgeServerStats,\n rootDirectory,\n })\n )\n } catch (err) {\n return middlewareResponse.badRequest(res)\n }\n } else if (pathname === '/__nextjs_launch-editor') {\n const frame = {\n file: searchParams.get('file') as string,\n methodName: searchParams.get('methodName') as string,\n line1: parseInt(searchParams.get('line1') ?? '1', 10) || 1,\n column1: parseInt(searchParams.get('column1') ?? '1', 10) || 1,\n arguments: searchParams.getAll('arguments').filter(Boolean),\n } satisfies StackFrame\n\n if (!frame.file) return middlewareResponse.badRequest(res)\n\n let openEditorResult\n const isAppRelativePath = searchParams.get('isAppRelativePath') === '1'\n if (isAppRelativePath) {\n const relativeFilePath = searchParams.get('file') || ''\n const appPath = path.join(\n 'app',\n isSrcDir ? 'src' : '',\n relativeFilePath\n )\n openEditorResult = await openFileInEditor(appPath, 1, 1, rootDirectory)\n } else {\n // TODO: How do we differentiate layers and actual file paths with round brackets?\n // frame files may start with their webpack layer, like (middleware)/middleware.js\n const filePath = frame.file.replace(/^\\([^)]+\\)\\//, '')\n openEditorResult = await openFileInEditor(\n filePath,\n frame.line1,\n frame.column1 ?? 1,\n rootDirectory\n )\n }\n if (openEditorResult.error) {\n console.error('Failed to launch editor:', openEditorResult.error)\n return middlewareResponse.internalServerError(\n res,\n openEditorResult.error\n )\n }\n if (!openEditorResult.found) {\n return middlewareResponse.notFound(res)\n }\n return middlewareResponse.noContent(res)\n }\n\n return next()\n }\n}\n\nexport function getSourceMapMiddleware(options: {\n clientStats: () => webpack.Stats | null\n serverStats: () => webpack.Stats | null\n edgeServerStats: () => webpack.Stats | null\n}) {\n const { clientStats, serverStats, edgeServerStats } = options\n\n return async function (\n req: IncomingMessage,\n res: ServerResponse,\n next: () => void\n ): Promise<void> {\n const { pathname, searchParams } = new URL(`http://n${req.url}`)\n\n if (pathname !== '/__nextjs_source-map') {\n return next()\n }\n\n const filename = searchParams.get('filename')\n\n if (!filename) {\n return middlewareResponse.badRequest(res)\n }\n\n let source: Source | undefined\n\n try {\n source = await getSource(\n {\n file: filename,\n // Webpack doesn't use Index Source Maps\n line1: null,\n column1: null,\n },\n {\n getCompilations: () => {\n const compilations: webpack.Compilation[] = []\n\n for (const stats of [\n clientStats(),\n serverStats(),\n edgeServerStats(),\n ]) {\n if (stats?.compilation) {\n compilations.push(stats.compilation)\n }\n }\n\n return compilations\n },\n }\n )\n } catch (error) {\n return middlewareResponse.internalServerError(res, error)\n }\n\n if (!source) {\n return middlewareResponse.noContent(res)\n }\n\n return middlewareResponse.json(res, source.sourceMap)\n }\n}\n"],"names":["findSourceMap","path","fileURLToPath","pathToFileURL","SourceMapConsumer","getSourceMapFromFile","devirtualizeReactServerURL","findApplicableSourceMapPayload","sourceMapIgnoreListsEverything","openFileInEditor","getOriginalCodeFrame","ignoreListAnonymousStackFramesIfSandwiched","middlewareResponse","formatStackFrameFile","inspect","shouldIgnoreSource","sourceURL","includes","startsWith","getModuleById","id","compilation","chunkGraph","modules","find","module","getModuleId","findModuleNotFoundFromError","errorMessage","match","getSourcePath","source","replace","findOriginalSourcePositionAndContent","sourceMap","position","consumer","cause","console","error","Error","file","sourcePosition","originalPositionFor","line","line1","column","column1","sourceContent","sourceContentFor","destroy","getIgnoredSources","ignoreList","Set","moduleFilenames","sources","index","length","webpackSourceURL","formattedFilePath","add","ignoredSources","map","url","ignored","has","indexOf","content","sourcesContent","isIgnoredSource","ignoredSource","findOriginalSourcePositionAndContentFromCompilation","moduleId","importedModule","buildInfo","importLocByPath","get","createOriginalStackFrame","ignoredByDefault","rootDirectory","frame","moduleNotFound","result","type","undefined","moduleURL","sourcePath","filePath","resolve","resolvedFilePath","relative","traced","methodName","arguments","originalStackFrame","originalCodeFrame","getSourceMapFromCompilation","codeGenerationResult","codeGenerationResults","err","getSource","options","getCompilations","nativeSourceMap","sourceMapPayload","payload","isAbsolute","href","getOriginalStackFrames","isServer","isEdgeServer","isAppDirectory","frames","clientStats","serverStats","edgeServerStats","frameResponses","Promise","all","getOriginalStackFrame","then","value","status","reason","colors","filename","compilations","push","defaultNormalizedStackFrameLocation","defaultStackFrame","originalStackFrameResponse","getOverlayMiddleware","isSrcDir","req","res","next","pathname","searchParams","URL","method","badRequest","body","reject","data","on","chunk","JSON","parse","json","parseInt","getAll","filter","Boolean","openEditorResult","isAppRelativePath","relativeFilePath","appPath","join","internalServerError","found","notFound","noContent","getSourceMapMiddleware","stats"],"mappings":"AAAA,SAASA,aAAa,QAAwB,SAAQ;AACtD,OAAOC,UAAU,OAAM;AACvB,SAASC,aAAa,EAAEC,aAAa,QAAQ,MAAK;AAClD,SAASC,iBAAiB,QAAQ,kCAAiC;AACnE,SAASC,oBAAoB,QAAQ,6BAA4B;AACjE,SACEC,0BAA0B,EAC1BC,8BAA8B,EAC9BC,8BAA8B,QAGzB,qBAAoB;AAC3B,SAASC,gBAAgB,QAAQ,2CAA0C;AAC3E,SACEC,oBAAoB,EACpBC,0CAA0C,QAMrC,oCAAmC;AAC1C,SAASC,kBAAkB,QAAQ,iDAAgD;AAQnF,SAASC,oBAAoB,QAAQ,iDAAgD;AAErF,SAASC,OAAO,QAAQ,OAAM;AAE9B,SAASC,mBAAmBC,SAAiB;IAC3C,OACEA,UAAUC,QAAQ,CAAC,mBACnB,2EAA2E;IAC3ED,UAAUC,QAAQ,CAAC,gBACnBD,UAAUE,UAAU,CAAC;AAEzB;AAyBA,SAASC,cACPC,EAAsB,EACtBC,WAAgC;IAEhC,MAAM,EAAEC,UAAU,EAAEC,OAAO,EAAE,GAAGF;IA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AAEC,WAAW,EAAEC,eAAe,EAAE,GAAGd;IAEtD,OAAO,eACLgC,GAAoB,EACpBC,GAAmB,EACnBC,IAAgB;QAEhB,MAAM,EAAEC,QAAQ,EAAEC,YAAY,EAAE,GAAG,IAAIC,IAAI,CAAC,QAAQ,EAAEL,IAAItE,GAAG,EAAE;QAE/D,IAAIyE,aAAa,wBAAwB;YACvC,OAAOD;QACT;QAEA,MAAMV,WAAWY,aAAa7D,GAAG,CAAC;QAElC,IAAI,CAACiD,UAAU;YACb,OAAOjH,mBAAmBgI,UAAU,CAACN;QACvC;QAEA,IAAIvG;QAEJ,IAAI;YACFA,SAAS,MAAMqE,UACb;gBACE3D,MAAMoF;gBACN,wCAAwC;gBACxChF,OAAO;gBACPE,SAAS;YACX,GACA;gBACEuD,iBAAiB;oBACf,MAAMwB,eAAsC,EAAE;oBAE9C,KAAK,MAAMqC,SAAS;wBAClBlD;wBACAC;wBACAC;qBACD,CAAE;wBACD,IAAIgD,yBAAAA,MAAO9I,WAAW,EAAE;4BACtByG,aAAaC,IAAI,CAACoC,MAAM9I,WAAW;wBACrC;oBACF;oBAEA,OAAOyG;gBACT;YACF;QAEJ,EAAE,OAAOvF,OAAO;YACd,OAAO3B,mBAAmBkJ,mBAAmB,CAACxB,KAAK/F;QACrD;QAEA,IAAI,CAACR,QAAQ;YACX,OAAOnB,mBAAmBqJ,SAAS,CAAC3B;QACtC;QAEA,OAAO1H,mBAAmBwI,IAAI,CAACd,KAAKvG,OAAOG,SAAS;IACtD;AACF","ignoreList":[0]}
@@ -21,7 +21,7 @@ import { experimentalSchema } from '../config-schema';
21
21
  if (parts.length > 0) {
22
22
  versionSuffix = ` (${parts.join(', ')})`;
23
23
  }
24
- Log.bootstrap(`${bold(purple(`${Log.prefixes.ready} Next.js ${"16.2.0-canary.1"}`))}${versionSuffix}`);
24
+ Log.bootstrap(`${bold(purple(`${Log.prefixes.ready} Next.js ${"16.2.0-canary.2"}`))}${versionSuffix}`);
25
25
  if (appUrl) {
26
26
  Log.bootstrap(`- Local: ${appUrl}`);
27
27
  }
@@ -109,7 +109,7 @@ export async function getRequestHandlers({ dir, port, isDev, onDevServerCleanup,
109
109
  export async function startServer(serverOptions) {
110
110
  const { dir, isDev, hostname, minimalMode, allowRetry, keepAliveTimeout, selfSignedCertificate } = serverOptions;
111
111
  let { port } = serverOptions;
112
- process.title = `next-server (v${"16.2.0-canary.1"})`;
112
+ process.title = `next-server (v${"16.2.0-canary.2"})`;
113
113
  let handlersReady = ()=>{};
114
114
  let handlersError = ()=>{};
115
115
  let handlersPromise = new Promise((resolve, reject)=>{
@@ -1,5 +1,5 @@
1
1
  export function isStableBuild() {
2
- return !"16.2.0-canary.1"?.includes('canary') && !process.env.__NEXT_TEST_MODE && !process.env.NEXT_PRIVATE_LOCAL_DEV;
2
+ return !"16.2.0-canary.2"?.includes('canary') && !process.env.__NEXT_TEST_MODE && !process.env.NEXT_PRIVATE_LOCAL_DEV;
3
3
  }
4
4
  export class CanaryOnlyConfigError extends Error {
5
5
  constructor(arg){
@@ -2,4 +2,4 @@ import type { OriginalStackFrame } from '../../../shared/stack-frame';
2
2
  export declare const CallStackFrame: React.FC<{
3
3
  frame: OriginalStackFrame;
4
4
  }>;
5
- export declare const CALL_STACK_FRAME_STYLES = "\n [data-nextjs-call-stack-frame-no-source] {\n padding: 6px 8px;\n margin-bottom: 4px;\n\n border-radius: var(--rounded-lg);\n }\n\n [data-nextjs-call-stack-frame-no-source]:last-child {\n margin-bottom: 0;\n }\n\n [data-nextjs-call-stack-frame-ignored=\"true\"] {\n opacity: 0.6;\n }\n\n [data-nextjs-call-stack-frame] {\n user-select: text;\n display: block;\n box-sizing: border-box;\n\n user-select: text;\n -webkit-user-select: text;\n -moz-user-select: text;\n -ms-user-select: text;\n\n padding: 6px 8px;\n\n border-radius: var(--rounded-lg);\n }\n\n .call-stack-frame-method-name {\n display: flex;\n align-items: center;\n gap: 4px;\n\n margin-bottom: 4px;\n font-family: var(--font-stack-monospace);\n\n color: var(--color-gray-1000);\n font-size: var(--size-14);\n font-weight: 500;\n line-height: var(--size-20);\n\n svg {\n width: var(--size-16px);\n height: var(--size-16px);\n }\n }\n\n .open-in-editor-button, .source-mapping-error-button {\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: var(--rounded-full);\n padding: 4px;\n color: var(--color-font);\n\n svg {\n width: var(--size-16);\n height: var(--size-16);\n }\n\n &:focus-visible {\n outline: var(--focus-ring);\n outline-offset: -2px;\n }\n\n &:hover {\n background: var(--color-gray-100);\n }\n }\n\n .call-stack-frame-file-source {\n color: var(--color-gray-900);\n font-size: var(--size-14);\n line-height: var(--size-20);\n }\n";
5
+ export declare const CALL_STACK_FRAME_STYLES = "\n [data-nextjs-call-stack-frame-no-source] {\n padding: 6px 8px;\n margin-bottom: 4px;\n\n border-radius: var(--rounded-lg);\n }\n\n [data-nextjs-call-stack-frame-no-source]:last-child {\n margin-bottom: 0;\n }\n\n [data-nextjs-call-stack-frame-ignored=\"true\"] {\n opacity: 0.6;\n }\n\n [data-nextjs-call-stack-frame] {\n user-select: text;\n display: block;\n box-sizing: border-box;\n\n user-select: text;\n -webkit-user-select: text;\n -moz-user-select: text;\n -ms-user-select: text;\n\n padding: 6px 8px;\n\n border-radius: var(--rounded-lg);\n }\n\n .call-stack-frame-method-name {\n display: flex;\n align-items: center;\n gap: 4px;\n\n margin-bottom: 4px;\n font-family: var(--font-stack-monospace);\n\n color: var(--color-gray-1000);\n font-size: var(--size-14);\n font-weight: 500;\n line-height: var(--size-20);\n\n svg {\n width: var(--size-16px);\n height: var(--size-16px);\n }\n }\n\n .open-in-editor-button, .source-mapping-error-button {\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: var(--rounded-full);\n padding: 4px;\n color: var(--color-font);\n\n svg {\n width: var(--size-16);\n height: var(--size-16);\n }\n\n &:focus-visible {\n outline: var(--focus-ring);\n outline-offset: -2px;\n }\n\n &:hover {\n background: var(--color-gray-100);\n }\n }\n\n .call-stack-frame-file {\n color: var(--color-gray-900);\n font-size: var(--size-14);\n line-height: var(--size-20);\n word-wrap: break-word;\n }\n";
@@ -16,4 +16,4 @@ interface RejectedOriginalStackFrame extends OriginalStackFrameResponse {
16
16
  }
17
17
  export type OriginalStackFrame = ResolvedOriginalStackFrame | RejectedOriginalStackFrame;
18
18
  export declare function getOriginalStackFrames(frames: readonly StackFrame[], type: 'server' | 'edge-server' | null, isAppDir: boolean): Promise<readonly OriginalStackFrame[]>;
19
- export declare function getFrameSource(frame: StackFrame): string;
19
+ export declare function getStackFrameFile(frame: StackFrame): string;
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
5
  0 && (module.exports = {
6
- getFrameSource: null,
7
- getOriginalStackFrames: null
6
+ getOriginalStackFrames: null,
7
+ getStackFrameFile: null
8
8
  });
9
9
  function _export(target, all) {
10
10
  for(var name in all)Object.defineProperty(target, name, {
@@ -13,11 +13,11 @@ function _export(target, all) {
13
13
  });
14
14
  }
15
15
  _export(exports, {
16
- getFrameSource: function() {
17
- return getFrameSource;
18
- },
19
16
  getOriginalStackFrames: function() {
20
17
  return getOriginalStackFrames;
18
+ },
19
+ getStackFrameFile: function() {
20
+ return getStackFrameFile;
21
21
  }
22
22
  });
23
23
  const _webpackmodulepath = require("./webpack-module-path");
@@ -96,13 +96,13 @@ async function getOriginalStackFrames(frames, type, isAppDir) {
96
96
  reason: `Failed to fetch the original stack frames ${reason ? `: ${reason}` : ''}`
97
97
  })));
98
98
  }
99
- function getFrameSource(frame) {
99
+ function getStackFrameFile(frame) {
100
100
  if (!frame.file) return '';
101
101
  const isWebpackFrame = (0, _webpackmodulepath.isWebpackInternalResource)(frame.file);
102
102
  let str = '';
103
103
  // Skip URL parsing for webpack internal file paths.
104
104
  if (isWebpackFrame) {
105
- str = (0, _webpackmodulepath.formatFrameSourceFile)(frame.file);
105
+ str = (0, _webpackmodulepath.formatStackFrameFile)(frame.file);
106
106
  } else {
107
107
  try {
108
108
  const u = new URL(frame.file);
@@ -120,9 +120,9 @@ function getFrameSource(frame) {
120
120
  // Strip query string information as it's typically too verbose to be
121
121
  // meaningful.
122
122
  parsedPath += u.pathname;
123
- str = (0, _webpackmodulepath.formatFrameSourceFile)(parsedPath);
123
+ str = (0, _webpackmodulepath.formatStackFrameFile)(parsedPath);
124
124
  } catch {
125
- str = (0, _webpackmodulepath.formatFrameSourceFile)(frame.file);
125
+ str = (0, _webpackmodulepath.formatStackFrameFile)(frame.file);
126
126
  }
127
127
  }
128
128
  if (!(0, _webpackmodulepath.isWebpackInternalResource)(frame.file) && frame.line1 != null) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/next-devtools/shared/stack-frame.ts"],"sourcesContent":["import type {\n OriginalStackFrameResponse,\n OriginalStackFrameResponseResult,\n OriginalStackFramesRequest,\n StackFrame,\n} from '../server/shared'\nimport {\n isWebpackInternalResource,\n formatFrameSourceFile,\n} from './webpack-module-path'\n\nexport type { StackFrame }\n\ninterface ResolvedOriginalStackFrame extends OriginalStackFrameResponse {\n error: false\n reason: null\n external: boolean\n ignored: boolean\n sourceStackFrame: StackFrame\n}\n\ninterface RejectedOriginalStackFrame extends OriginalStackFrameResponse {\n error: true\n reason: string\n external: boolean\n ignored: boolean\n sourceStackFrame: StackFrame\n}\n\nexport type OriginalStackFrame =\n | ResolvedOriginalStackFrame\n | RejectedOriginalStackFrame\n\nfunction getOriginalStackFrame(\n source: StackFrame,\n response: OriginalStackFrameResponseResult\n): Promise<OriginalStackFrame> {\n async function _getOriginalStackFrame(): Promise<ResolvedOriginalStackFrame> {\n if (response.status === 'rejected') {\n throw new Error(response.reason)\n }\n\n const body: OriginalStackFrameResponse = response.value\n\n return {\n error: false,\n reason: null,\n external: false,\n sourceStackFrame: source,\n originalStackFrame: body.originalStackFrame,\n originalCodeFrame: body.originalCodeFrame || null,\n ignored: body.originalStackFrame?.ignored || false,\n }\n }\n\n // TODO: merge this section into ignoredList handling\n if (source.file === 'file://' || source.file?.match(/https?:\\/\\//)) {\n return Promise.resolve({\n error: false,\n reason: null,\n external: true,\n sourceStackFrame: source,\n originalStackFrame: null,\n originalCodeFrame: null,\n ignored: true,\n })\n }\n\n return _getOriginalStackFrame().catch(\n (err: Error): RejectedOriginalStackFrame => ({\n error: true,\n reason: err?.message ?? err?.toString() ?? 'Unknown Error',\n external: false,\n sourceStackFrame: source,\n originalStackFrame: null,\n originalCodeFrame: null,\n ignored: false,\n })\n )\n}\n\nexport async function getOriginalStackFrames(\n frames: readonly StackFrame[],\n type: 'server' | 'edge-server' | null,\n isAppDir: boolean\n): Promise<readonly OriginalStackFrame[]> {\n const req: OriginalStackFramesRequest = {\n frames,\n isServer: type === 'server',\n isEdgeServer: type === 'edge-server',\n isAppDirectory: isAppDir,\n }\n\n let res: Response | undefined = undefined\n let reason: string | undefined = undefined\n try {\n res = await fetch('/__nextjs_original-stack-frames', {\n method: 'POST',\n body: JSON.stringify(req),\n })\n } catch (e) {\n reason = e + ''\n }\n\n // When fails to fetch the original stack frames, we reject here to be\n // caught at `_getOriginalStackFrame()` and return the stack frames so\n // that the error overlay can render.\n if (res && res.ok && res.status !== 204) {\n const data = await res.json()\n return Promise.all(\n frames.map((frame, index) => getOriginalStackFrame(frame, data[index]))\n )\n } else {\n if (res) {\n reason = await res.text()\n }\n }\n return Promise.all(\n frames.map((frame) =>\n getOriginalStackFrame(frame, {\n status: 'rejected',\n reason: `Failed to fetch the original stack frames ${reason ? `: ${reason}` : ''}`,\n })\n )\n )\n}\n\nexport function getFrameSource(frame: StackFrame): string {\n if (!frame.file) return ''\n\n const isWebpackFrame = isWebpackInternalResource(frame.file)\n\n let str = ''\n // Skip URL parsing for webpack internal file paths.\n if (isWebpackFrame) {\n str = formatFrameSourceFile(frame.file)\n } else {\n try {\n const u = new URL(frame.file)\n\n let parsedPath = ''\n // Strip the origin for same-origin scripts.\n if (globalThis.location?.origin !== u.origin) {\n // URLs can be valid without an `origin`, so long as they have a\n // `protocol`. However, `origin` is preferred.\n if (u.origin === 'null') {\n parsedPath += u.protocol\n } else {\n parsedPath += u.origin\n }\n }\n\n // Strip query string information as it's typically too verbose to be\n // meaningful.\n parsedPath += u.pathname\n str = formatFrameSourceFile(parsedPath)\n } catch {\n str = formatFrameSourceFile(frame.file)\n }\n }\n\n if (!isWebpackInternalResource(frame.file) && frame.line1 != null) {\n // We don't need line and column numbers for anonymous sources because\n // there's no entrypoint for the location anyway.\n if (str && frame.file !== '<anonymous>') {\n if (frame.column1 != null) {\n str += ` (${frame.line1}:${frame.column1})`\n } else {\n str += ` (${frame.line1})`\n }\n }\n }\n return str\n}\n"],"names":["getFrameSource","getOriginalStackFrames","getOriginalStackFrame","source","response","_getOriginalStackFrame","status","Error","reason","body","value","error","external","sourceStackFrame","originalStackFrame","originalCodeFrame","ignored","file","match","Promise","resolve","catch","err","message","toString","frames","type","isAppDir","req","isServer","isEdgeServer","isAppDirectory","res","undefined","fetch","method","JSON","stringify","e","ok","data","json","all","map","frame","index","text","isWebpackFrame","isWebpackInternalResource","str","formatFrameSourceFile","u","URL","parsedPath","globalThis","location","origin","protocol","pathname","line1","column1"],"mappings":";;;;;;;;;;;;;;;IA+HgBA,cAAc;eAAdA;;IA9CMC,sBAAsB;eAAtBA;;;mCAxEf;AAwBP,SAASC,sBACPC,MAAkB,EAClBC,QAA0C;IAE1C,eAAeC;QACb,IAAID,SAASE,MAAM,KAAK,YAAY;YAClC,MAAM,qBAA0B,CAA1B,IAAIC,MAAMH,SAASI,MAAM,GAAzB,qBAAA;uBAAA;4BAAA;8BAAA;YAAyB;QACjC;QAEA,MAAMC,OAAmCL,SAASM,KAAK;QAEvD,OAAO;YACLC,OAAO;YACPH,QAAQ;YACRI,UAAU;YACVC,kBAAkBV;YAClBW,oBAAoBL,KAAKK,kBAAkB;YAC3CC,mBAAmBN,KAAKM,iBAAiB,IAAI;YAC7CC,SAASP,KAAKK,kBAAkB,EAAEE,WAAW;QAC/C;IACF;IAEA,qDAAqD;IACrD,IAAIb,OAAOc,IAAI,KAAK,a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":["../../../src/next-devtools/shared/stack-frame.ts"],"sourcesContent":["import type {\n OriginalStackFrameResponse,\n OriginalStackFrameResponseResult,\n OriginalStackFramesRequest,\n StackFrame,\n} from '../server/shared'\nimport {\n isWebpackInternalResource,\n formatStackFrameFile,\n} from './webpack-module-path'\n\nexport type { StackFrame }\n\ninterface ResolvedOriginalStackFrame extends OriginalStackFrameResponse {\n error: false\n reason: null\n external: boolean\n ignored: boolean\n sourceStackFrame: StackFrame\n}\n\ninterface RejectedOriginalStackFrame extends OriginalStackFrameResponse {\n error: true\n reason: string\n external: boolean\n ignored: boolean\n sourceStackFrame: StackFrame\n}\n\nexport type OriginalStackFrame =\n | ResolvedOriginalStackFrame\n | RejectedOriginalStackFrame\n\nfunction getOriginalStackFrame(\n source: StackFrame,\n response: OriginalStackFrameResponseResult\n): Promise<OriginalStackFrame> {\n async function _getOriginalStackFrame(): Promise<ResolvedOriginalStackFrame> {\n if (response.status === 'rejected') {\n throw new Error(response.reason)\n }\n\n const body: OriginalStackFrameResponse = response.value\n\n return {\n error: false,\n reason: null,\n external: false,\n sourceStackFrame: source,\n originalStackFrame: body.originalStackFrame,\n originalCodeFrame: body.originalCodeFrame || null,\n ignored: body.originalStackFrame?.ignored || false,\n }\n }\n\n // TODO: merge this section into ignoredList handling\n if (source.file === 'file://' || source.file?.match(/https?:\\/\\//)) {\n return Promise.resolve({\n error: false,\n reason: null,\n external: true,\n sourceStackFrame: source,\n originalStackFrame: null,\n originalCodeFrame: null,\n ignored: true,\n })\n }\n\n return _getOriginalStackFrame().catch(\n (err: Error): RejectedOriginalStackFrame => ({\n error: true,\n reason: err?.message ?? err?.toString() ?? 'Unknown Error',\n external: false,\n sourceStackFrame: source,\n originalStackFrame: null,\n originalCodeFrame: null,\n ignored: false,\n })\n )\n}\n\nexport async function getOriginalStackFrames(\n frames: readonly StackFrame[],\n type: 'server' | 'edge-server' | null,\n isAppDir: boolean\n): Promise<readonly OriginalStackFrame[]> {\n const req: OriginalStackFramesRequest = {\n frames,\n isServer: type === 'server',\n isEdgeServer: type === 'edge-server',\n isAppDirectory: isAppDir,\n }\n\n let res: Response | undefined = undefined\n let reason: string | undefined = undefined\n try {\n res = await fetch('/__nextjs_original-stack-frames', {\n method: 'POST',\n body: JSON.stringify(req),\n })\n } catch (e) {\n reason = e + ''\n }\n\n // When fails to fetch the original stack frames, we reject here to be\n // caught at `_getOriginalStackFrame()` and return the stack frames so\n // that the error overlay can render.\n if (res && res.ok && res.status !== 204) {\n const data = await res.json()\n return Promise.all(\n frames.map((frame, index) => getOriginalStackFrame(frame, data[index]))\n )\n } else {\n if (res) {\n reason = await res.text()\n }\n }\n return Promise.all(\n frames.map((frame) =>\n getOriginalStackFrame(frame, {\n status: 'rejected',\n reason: `Failed to fetch the original stack frames ${reason ? `: ${reason}` : ''}`,\n })\n )\n )\n}\n\nexport function getStackFrameFile(frame: StackFrame): string {\n if (!frame.file) return ''\n\n const isWebpackFrame = isWebpackInternalResource(frame.file)\n\n let str = ''\n // Skip URL parsing for webpack internal file paths.\n if (isWebpackFrame) {\n str = formatStackFrameFile(frame.file)\n } else {\n try {\n const u = new URL(frame.file)\n\n let parsedPath = ''\n // Strip the origin for same-origin scripts.\n if (globalThis.location?.origin !== u.origin) {\n // URLs can be valid without an `origin`, so long as they have a\n // `protocol`. However, `origin` is preferred.\n if (u.origin === 'null') {\n parsedPath += u.protocol\n } else {\n parsedPath += u.origin\n }\n }\n\n // Strip query string information as it's typically too verbose to be\n // meaningful.\n parsedPath += u.pathname\n str = formatStackFrameFile(parsedPath)\n } catch {\n str = formatStackFrameFile(frame.file)\n }\n }\n\n if (!isWebpackInternalResource(frame.file) && frame.line1 != null) {\n // We don't need line and column numbers for anonymous sources because\n // there's no entrypoint for the location anyway.\n if (str && frame.file !== '<anonymous>') {\n if (frame.column1 != null) {\n str += ` (${frame.line1}:${frame.column1})`\n } else {\n str += ` (${frame.line1})`\n }\n }\n }\n return str\n}\n"],"names":["getOriginalStackFrames","getStackFrameFile","getOriginalStackFrame","source","response","_getOriginalStackFrame","status","Error","reason","body","value","error","external","sourceStackFrame","originalStackFrame","originalCodeFrame","ignored","file","match","Promise","resolve","catch","err","message","toString","frames","type","isAppDir","req","isServer","isEdgeServer","isAppDirectory","res","undefined","fetch","method","JSON","stringify","e","ok","data","json","all","map","frame","index","text","isWebpackFrame","isWebpackInternalResource","str","formatStackFrameFile","u","URL","parsedPath","globalThis","location","origin","protocol","pathname","line1","column1"],"mappings":";;;;;;;;;;;;;;;IAiFsBA,sBAAsB;eAAtBA;;IA8CNC,iBAAiB;eAAjBA;;;mCAtHT;AAwBP,SAASC,sBACPC,MAAkB,EAClBC,QAA0C;IAE1C,eAAeC;QACb,IAAID,SAASE,MAAM,KAAK,YAAY;YAClC,MAAM,qBAA0B,CAA1B,IAAIC,MAAMH,SAASI,MAAM,GAAzB,qBAAA;uBAAA;4BAAA;8BAAA;YAAyB;QACjC;QAEA,MAAMC,OAAmCL,SAASM,KAAK;QAEvD,OAAO;YACLC,OAAO;YACPH,QAAQ;YACRI,UAAU;YACVC,kBAAkBV;YAClBW,oBAAoBL,KAAKK,kBAAkB;YAC3CC,mBAAmBN,KAAKM,iBAAiB,IAAI;YAC7CC,SAASP,KAAKK,kBAAkB,EAAEE,WAAW;QAC/C;IACF;IAEA,qDAAqD;IACrD,IAAIb,OAAOc,IAAI,KAAK,aAAad,OAAOc,IAAI,EAAEC,MAAM,gBAAgB;QAClE,OAAOC,QAAQC,OAAO,CAAC;YACrBT,OAAO;YACPH,QAAQ;YACRI,UAAU;YACVC,kBAAkBV;YAClBW,oBAAoB;YACpBC,mBAAmB;YACnBC,SAAS;QACX;IACF;IAEA,OAAOX,yBAAyBgB,KAAK,CACnC,CAACC,MAA4C,CAAA;YAC3CX,OAAO;YACPH,QAAQc,KAAKC,WAAWD,KAAKE,cAAc;YAC3CZ,UAAU;YACVC,kBAAkBV;YAClBW,oBAAoB;YACpBC,mBAAmB;YACnBC,SAAS;QACX,CAAA;AAEJ;AAEO,eAA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AC5C,IAAIC,WAAWC,QAAQ,EAAEC,WAAWL,EAAEK,MAAM,EAAE;gBAC5C,gEAAgE;gBAChE,8CAA8C;gBAC9C,IAAIL,EAAEK,MAAM,KAAK,QAAQ;oBACvBH,cAAcF,EAAEM,QAAQ;gBAC1B,OAAO;oBACLJ,cAAcF,EAAEK,MAAM;gBACxB;YACF;YAEA,qEAAqE;YACrE,cAAc;YACdH,cAAcF,EAAEO,QAAQ;YACxBT,MAAMC,IAAAA,uCAAoB,EAACG;QAC7B,EAAE,OAAM;YACNJ,MAAMC,IAAAA,uCAAoB,EAACN,MAAM3B,IAAI;QACvC;IACF;IAEA,IAAI,CAAC+B,IAAAA,4CAAyB,EAACJ,MAAM3B,IAAI,KAAK2B,MAAMe,KAAK,IAAI,MAAM;QACjE,sEAAsE;QACtE,iDAAiD;QACjD,IAAIV,OAAOL,MAAM3B,IAAI,KAAK,eAAe;YACvC,IAAI2B,MAAMgB,OAAO,IAAI,MAAM;gBACzBX,OAAO,CAAC,EAAE,EAAEL,MAAMe,KAAK,CAAC,CAAC,EAAEf,MAAMgB,OAAO,CAAC,CAAC,CAAC;YAC7C,OAAO;gBACLX,OAAO,CAAC,EAAE,EAAEL,MAAMe,KAAK,CAAC,CAAC,CAAC;YAC5B;QACF;IACF;IACA,OAAOV;AACT","ignoreList":[0]}
@@ -7,4 +7,4 @@ export declare function isWebpackInternalResource(file: string): boolean;
7
7
  * webpack://./src/hello.tsx => ./src/hello.tsx
8
8
  * webpack:///./src/hello.tsx => ./src/hello.tsx
9
9
  */
10
- export declare function formatFrameSourceFile(file: string): string;
10
+ export declare function formatStackFrameFile(file: string): string;
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
5
  0 && (module.exports = {
6
- formatFrameSourceFile: null,
6
+ formatStackFrameFile: null,
7
7
  isWebpackInternalResource: null
8
8
  });
9
9
  function _export(target, all) {
@@ -13,8 +13,8 @@ function _export(target, all) {
13
13
  });
14
14
  }
15
15
  _export(exports, {
16
- formatFrameSourceFile: function() {
17
- return formatFrameSourceFile;
16
+ formatStackFrameFile: function() {
17
+ return formatStackFrameFile;
18
18
  },
19
19
  isWebpackInternalResource: function() {
20
20
  return isWebpackInternalResource;
@@ -31,7 +31,7 @@ function isWebpackInternalResource(file) {
31
31
  }
32
32
  return false;
33
33
  }
34
- function formatFrameSourceFile(file) {
34
+ function formatStackFrameFile(file) {
35
35
  for (const regex of replacementRegExes){
36
36
  file = file.replace(regex, '');
37
37
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/next-devtools/shared/webpack-module-path.ts"],"sourcesContent":["const replacementRegExes = [\n /^webpack-internal:\\/\\/\\/(\\([\\w-]+\\)\\/)?/,\n /^(webpack:\\/\\/\\/|webpack:\\/\\/(_N_E\\/)?)(\\([\\w-]+\\)\\/)?/,\n]\n\nexport function isWebpackInternalResource(file: string) {\n for (const regex of replacementRegExes) {\n if (regex.test(file)) return true\n\n file = file.replace(regex, '')\n }\n\n return false\n}\n\n/**\n * Format the webpack internal id to original file path\n *\n * webpack-internal:///./src/hello.tsx => ./src/hello.tsx\n * webpack://_N_E/./src/hello.tsx => ./src/hello.tsx\n * webpack://./src/hello.tsx => ./src/hello.tsx\n * webpack:///./src/hello.tsx => ./src/hello.tsx\n */\nexport function formatFrameSourceFile(file: string) {\n for (const regex of replacementRegExes) {\n file = file.replace(regex, '')\n }\n\n return file\n}\n"],"names":["formatFrameSourceFile","isWebpackInternalResource","replacementRegExes","file","regex","test","replace"],"mappings":";;;;;;;;;;;;;;;IAuBgBA,qBAAqB;eAArBA;;IAlBAC,yBAAyB;eAAzBA;;;AALhB,MAAMC,qBAAqB;IACzB;IACA;CACD;AAEM,SAASD,0BAA0BE,IAAY;IACpD,KAAK,MAAMC,SAASF,mBAAoB;QACtC,IAAIE,MAAMC,IAAI,CAACF,OAAO,OAAO;QAE7BA,OAAOA,KAAKG,OAAO,CAACF,OAAO;IAC7B;IAEA,OAAO;AACT;AAUO,SAASJ,sBAAsBG,IAAY;IAChD,KAAK,MAAMC,SAASF,mBAAoB;QACtCC,OAAOA,KAAKG,OAAO,CAACF,OAAO;IAC7B;IAEA,OAAOD;AACT","ignoreList":[0]}
1
+ {"version":3,"sources":["../../../src/next-devtools/shared/webpack-module-path.ts"],"sourcesContent":["const replacementRegExes = [\n /^webpack-internal:\\/\\/\\/(\\([\\w-]+\\)\\/)?/,\n /^(webpack:\\/\\/\\/|webpack:\\/\\/(_N_E\\/)?)(\\([\\w-]+\\)\\/)?/,\n]\n\nexport function isWebpackInternalResource(file: string) {\n for (const regex of replacementRegExes) {\n if (regex.test(file)) return true\n\n file = file.replace(regex, '')\n }\n\n return false\n}\n\n/**\n * Format the webpack internal id to original file path\n *\n * webpack-internal:///./src/hello.tsx => ./src/hello.tsx\n * webpack://_N_E/./src/hello.tsx => ./src/hello.tsx\n * webpack://./src/hello.tsx => ./src/hello.tsx\n * webpack:///./src/hello.tsx => ./src/hello.tsx\n */\nexport function formatStackFrameFile(file: string) {\n for (const regex of replacementRegExes) {\n file = file.replace(regex, '')\n }\n\n return file\n}\n"],"names":["formatStackFrameFile","isWebpackInternalResource","replacementRegExes","file","regex","test","replace"],"mappings":";;;;;;;;;;;;;;;IAuBgBA,oBAAoB;eAApBA;;IAlBAC,yBAAyB;eAAzBA;;;AALhB,MAAMC,qBAAqB;IACzB;IACA;CACD;AAEM,SAASD,0BAA0BE,IAAY;IACpD,KAAK,MAAMC,SAASF,mBAAoB;QACtC,IAAIE,MAAMC,IAAI,CAACF,OAAO,OAAO;QAE7BA,OAAOA,KAAKG,OAAO,CAACF,OAAO;IAC7B;IAEA,OAAO;AACT;AAUO,SAASJ,qBAAqBG,IAAY;IAC/C,KAAK,MAAMC,SAASF,mBAAoB;QACtCC,OAAOA,KAAKG,OAAO,CAACF,OAAO;IAC7B;IAEA,OAAOD;AACT","ignoreList":[0]}
@@ -567,6 +567,13 @@ const configSchema = _zod.z.lazy(()=>_zod.z.strictObject({
567
567
  _zod.z.object({
568
568
  ignore: _zod.z.array(_zod.z.instanceof(RegExp))
569
569
  })
570
+ ]).optional(),
571
+ browserToTerminal: _zod.z.union([
572
+ _zod.z.boolean(),
573
+ _zod.z.enum([
574
+ 'error',
575
+ 'warn'
576
+ ])
570
577
  ]).optional()
571
578
  }),
572
579
  _zod.z.literal(false)