@openuiai/next 16.0.7 → 16.0.9

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.
package/dist/bin/next CHANGED
@@ -79,7 +79,7 @@ const program = new NextRootCommand();
79
79
  program.name('next').description('The Next.js CLI allows you to develop, build, start your application, and more.').configureHelp({
80
80
  formatHelp: (cmd, helper)=>(0, _formatclihelpoutput.formatCliHelpOutput)(cmd, helper),
81
81
  subcommandTerm: (cmd)=>`${cmd.name()} ${cmd.usage()}`
82
- }).helpCommand(false).helpOption('-h, --help', 'Displays this message.').version(`Next.js v${"16.0.7"}`, '-v, --version', 'Outputs the Next.js version.');
82
+ }).helpCommand(false).helpOption('-h, --help', 'Displays this message.').version(`Next.js v${"16.0.8"}`, '-v, --version', 'Outputs the Next.js version.');
83
83
  program.command('build').description('Creates an optimized production build of your application. The output displays information about each route.').argument('[directory]', `A directory on which to build the application. ${(0, _picocolors.italic)('If no directory is provided, the current directory will be used.')}`).option('-d, --debug', 'Enables a more verbose build output.').option('--debug-prerender', 'Enables debug mode for prerendering. Not for production use!').option('--no-mangling', 'Disables mangling.').option('--profile', 'Enables production profiling for React.').option('--experimental-app-only', 'Builds only App Router routes.').option('--webpack', 'Builds using webpack.').addOption(new _commander.Option('--experimental-build-mode [mode]', 'Uses an experimental build mode.').choices([
84
84
  'compile',
85
85
  'generate',
@@ -373,7 +373,7 @@ async function build(dir, reactProductionProfiling = false, debugOutput = false,
373
373
  try {
374
374
  const nextBuildSpan = (0, _trace.trace)('next-build', undefined, {
375
375
  buildMode: experimentalBuildMode,
376
- version: "16.0.7"
376
+ version: "16.0.8"
377
377
  });
378
378
  _buildcontext.NextBuildContext.nextBuildSpan = nextBuildSpan;
379
379
  _buildcontext.NextBuildContext.dir = dir;
@@ -886,7 +886,7 @@ async function build(dir, reactProductionProfiling = false, debugOutput = false,
886
886
  // Files outside of the distDir can be "type": "module"
887
887
  await writeFileUtf8(_path.default.join(distDir, 'package.json'), '{"type": "commonjs"}');
888
888
  // These are written to distDir, so they need to come after creating and cleaning distDr.
889
- await (0, _builddiagnostics.recordFrameworkVersion)("16.0.7");
889
+ await (0, _builddiagnostics.recordFrameworkVersion)("16.0.8");
890
890
  await (0, _builddiagnostics.updateBuildDiagnostics)({
891
891
  buildStage: 'start'
892
892
  });
@@ -2535,7 +2535,7 @@ async function build(dir, reactProductionProfiling = false, debugOutput = false,
2535
2535
  configOutDir: _path.default.join(dir, configOutDir),
2536
2536
  staticPages,
2537
2537
  serverPropsPages,
2538
- nextVersion: "16.0.7",
2538
+ nextVersion: "16.0.8",
2539
2539
  tracingRoot: outputFileTracingRoot,
2540
2540
  hasNodeMiddleware,
2541
2541
  hasInstrumentationHook,
@@ -128,7 +128,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
128
128
  }
129
129
  return newObj;
130
130
  }
131
- const nextVersion = "16.0.7";
131
+ const nextVersion = "16.0.0"; // Use official Next.js version for SWC binaries
132
132
  const ArchName = (0, _os.arch)();
133
133
  const PlatformName = (0, _os.platform)();
134
134
  function infoLog(...args) {
@@ -1713,7 +1713,7 @@ async function getBaseWebpackConfig(dir, { buildId, encryptionKey, config, compi
1713
1713
  isClient && new _copyfileplugin.CopyFilePlugin({
1714
1714
  // file path to build output of `@next/polyfill-nomodule`
1715
1715
  filePath: require.resolve('./polyfills/polyfill-nomodule'),
1716
- cacheKey: "16.0.7",
1716
+ cacheKey: "16.0.8",
1717
1717
  name: `static/chunks/polyfills${dev ? '' : '-[hash]'}.js`,
1718
1718
  minimize: false,
1719
1719
  info: {
@@ -1904,7 +1904,7 @@ async function getBaseWebpackConfig(dir, { buildId, encryptionKey, config, compi
1904
1904
  // - Next.js location on disk (some loaders use absolute paths and some resolve options depend on absolute paths)
1905
1905
  // - Next.js version
1906
1906
  // - next.config.js keys that affect compilation
1907
- version: `${__dirname}|${"16.0.7"}|${configVars}`,
1907
+ version: `${__dirname}|${"16.0.8"}|${configVars}`,
1908
1908
  cacheDirectory: _path.default.join(distDir, 'cache', 'webpack'),
1909
1909
  // For production builds, it's more efficient to compress all cache files together instead of compression each one individually.
1910
1910
  // So we disable compression here and allow the build runner to take care of compressing the cache as a whole.
@@ -15,7 +15,7 @@ Object.defineProperty(exports, "appBootstrap", {
15
15
  });
16
16
  const _assetprefix = require("./asset-prefix");
17
17
  const _setattributesfromprops = require("./set-attributes-from-props");
18
- const version = "16.0.7";
18
+ const version = "16.0.8";
19
19
  window.next = {
20
20
  version,
21
21
  appDir: true
@@ -60,7 +60,7 @@ const _hooksclientcontextsharedruntime = require("../shared/lib/hooks-client-con
60
60
  const _onrecoverableerror = require("./react-client-callbacks/on-recoverable-error");
61
61
  const _tracer = /*#__PURE__*/ _interop_require_default._(require("./tracing/tracer"));
62
62
  const _isnextroutererror = require("./components/is-next-router-error");
63
- const version = "16.0.7";
63
+ const version = "16.0.8";
64
64
  let router;
65
65
  const emitter = (0, _mitt.default)();
66
66
  const looseToArray = (input)=>[].slice.call(input);
@@ -272,6 +272,8 @@ class ReactFlightWebpackPlugin {
272
272
  chunk = compilation.chunkGraph.getChunkModulesIterable(chunk);
273
273
  Array.from(chunk).forEach(function (module) {
274
274
  const moduleId = compilation.chunkGraph.getModuleId(module);
275
+ // Bun compatibility: skip if moduleId is undefined
276
+ if (moduleId === undefined || moduleId === null) return;
275
277
  recordModule(moduleId, module);
276
278
  module.modules &&
277
279
  module.modules.forEach((concatenatedMod) => {
@@ -305,7 +305,7 @@ export default async function build(dir, reactProductionProfiling = false, debug
305
305
  try {
306
306
  const nextBuildSpan = trace('next-build', undefined, {
307
307
  buildMode: experimentalBuildMode,
308
- version: "16.0.7"
308
+ version: "16.0.8"
309
309
  });
310
310
  NextBuildContext.nextBuildSpan = nextBuildSpan;
311
311
  NextBuildContext.dir = dir;
@@ -818,7 +818,7 @@ export default async function build(dir, reactProductionProfiling = false, debug
818
818
  // Files outside of the distDir can be "type": "module"
819
819
  await writeFileUtf8(path.join(distDir, 'package.json'), '{"type": "commonjs"}');
820
820
  // These are written to distDir, so they need to come after creating and cleaning distDr.
821
- await recordFrameworkVersion("16.0.7");
821
+ await recordFrameworkVersion("16.0.8");
822
822
  await updateBuildDiagnostics({
823
823
  buildStage: 'start'
824
824
  });
@@ -2467,7 +2467,7 @@ export default async function build(dir, reactProductionProfiling = false, debug
2467
2467
  configOutDir: path.join(dir, configOutDir),
2468
2468
  staticPages,
2469
2469
  serverPropsPages,
2470
- nextVersion: "16.0.7",
2470
+ nextVersion: "16.0.8",
2471
2471
  tracingRoot: outputFileTracingRoot,
2472
2472
  hasNodeMiddleware,
2473
2473
  hasInstrumentationHook,
@@ -8,7 +8,7 @@ import { eventSwcLoadFailure } from '../../telemetry/events/swc-load-failure';
8
8
  import { patchIncorrectLockfile } from '../../lib/patch-incorrect-lockfile';
9
9
  import { downloadNativeNextSwc, downloadWasmSwc } from '../../lib/download-swc';
10
10
  import { getDefineEnv } from '../define-env';
11
- const nextVersion = "16.0.7";
11
+ const nextVersion = "16.0.0"; // Use official Next.js version for SWC binaries
12
12
  const ArchName = arch();
13
13
  const PlatformName = platform();
14
14
  function infoLog(...args) {
@@ -1610,7 +1610,7 @@ export default async function getBaseWebpackConfig(dir, { buildId, encryptionKey
1610
1610
  isClient && new CopyFilePlugin({
1611
1611
  // file path to build output of `@next/polyfill-nomodule`
1612
1612
  filePath: require.resolve('./polyfills/polyfill-nomodule'),
1613
- cacheKey: "16.0.7",
1613
+ cacheKey: "16.0.8",
1614
1614
  name: `static/chunks/polyfills${dev ? '' : '-[hash]'}.js`,
1615
1615
  minimize: false,
1616
1616
  info: {
@@ -1801,7 +1801,7 @@ export default async function getBaseWebpackConfig(dir, { buildId, encryptionKey
1801
1801
  // - Next.js location on disk (some loaders use absolute paths and some resolve options depend on absolute paths)
1802
1802
  // - Next.js version
1803
1803
  // - next.config.js keys that affect compilation
1804
- version: `${__dirname}|${"16.0.7"}|${configVars}`,
1804
+ version: `${__dirname}|${"16.0.8"}|${configVars}`,
1805
1805
  cacheDirectory: path.join(distDir, 'cache', 'webpack'),
1806
1806
  // For production builds, it's more efficient to compress all cache files together instead of compression each one individually.
1807
1807
  // So we disable compression here and allow the build runner to take care of compressing the cache as a whole.
@@ -5,7 +5,7 @@
5
5
  * - next/script with `beforeInteractive` strategy
6
6
  */ import { getAssetPrefix } from './asset-prefix';
7
7
  import { setAttributesFromProps } from './set-attributes-from-props';
8
- const version = "16.0.7";
8
+ const version = "16.0.8";
9
9
  window.next = {
10
10
  version,
11
11
  appDir: true
@@ -25,7 +25,7 @@ import { SearchParamsContext, PathParamsContext } from '../shared/lib/hooks-clie
25
25
  import { onRecoverableError } from './react-client-callbacks/on-recoverable-error';
26
26
  import tracer from './tracing/tracer';
27
27
  import { isNextRouterError } from './components/is-next-router-error';
28
- export const version = "16.0.7";
28
+ export const version = "16.0.8";
29
29
  export let router;
30
30
  export const emitter = mitt();
31
31
  const looseToArray = (input)=>[].slice.call(input);
@@ -163,7 +163,7 @@ export default class HotReloaderWebpack {
163
163
  this.previewProps = previewProps;
164
164
  this.rewrites = rewrites;
165
165
  this.hotReloaderSpan = trace('hot-reloader', undefined, {
166
- version: "16.0.7"
166
+ version: "16.0.8"
167
167
  });
168
168
  // Ensure the hotReloaderSpan is flushed immediately as it's the parentSpan for all processing
169
169
  // of the current `next dev` invocation.
@@ -238,11 +238,18 @@ export async function getOriginalStackFrames({ isServer, isEdgeServer, isAppDire
238
238
  value
239
239
  };
240
240
  }, (reason)=>{
241
+ let reasonStr;
242
+ try {
243
+ reasonStr = inspect(reason, {
244
+ colors: false
245
+ });
246
+ } catch {
247
+ // Bun compatibility: inspect may throw on certain objects
248
+ reasonStr = String(reason);
249
+ }
241
250
  return {
242
251
  status: 'rejected',
243
- reason: inspect(reason, {
244
- colors: false
245
- })
252
+ reason: reasonStr
246
253
  };
247
254
  })));
248
255
  ignoreListAnonymousStackFramesIfSandwiched(frameResponses);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/server/dev/middleware-webpack.ts"],"sourcesContent":["import { findSourceMap, type SourceMap } from '../../lib/module-loader-adapter'\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 as ModernSourceMapPayload\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"],"mapp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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 '../../lib/module-loader-adapter'\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 as ModernSourceMapPayload\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 let reasonStr: string\n try {\n reasonStr = inspect(reason, { colors: false })\n } catch {\n // Bun compatibility: inspect may throw on certain objects\n reasonStr = String(reason)\n }\n return {\n status: 'rejected',\n reason: reasonStr,\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","reasonStr","colors","String","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,kCAAiC;AAC/E,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,EAA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J,SAAS,CAAC3B;QACtC;QAEA,OAAOC;IACT;AACF;AAEA,OAAO,SAAS2B,uBAAuB/D,OAItC;IACC,MAAM,EAAEY,WAAW,EAAEC,WAAW,EAAEC,eAAe,EAAE,GAAGd;IAEtD,OAAO,eACLkC,GAAoB,EACpBC,GAAmB,EACnBC,IAAgB;QAEhB,MAAM,EAAEC,QAAQ,EAAEC,YAAY,EAAE,GAAG,IAAIC,IAAI,CAAC,QAAQ,EAAEL,IAAIxE,GAAG,EAAE;QAE/D,IAAI2E,aAAa,wBAAwB;YACvC,OAAOD;QACT;QAEA,MAAMV,WAAWY,aAAa/D,GAAG,CAAC;QAElC,IAAI,CAACmD,UAAU;YACb,OAAOnH,mBAAmBkI,UAAU,CAACN;QACvC;QAEA,IAAIzG;QAEJ,IAAI;YACFA,SAAS,MAAMqE,UACb;gBACE3D,MAAMsF;gBACN,wCAAwC;gBACxClF,OAAO;gBACPE,SAAS;YACX,GACA;gBACEuD,iBAAiB;oBACf,MAAM0B,eAAsC,EAAE;oBAE9C,KAAK,MAAMqC,SAAS;wBAClBpD;wBACAC;wBACAC;qBACD,CAAE;wBACD,IAAIkD,yBAAAA,MAAOhJ,WAAW,EAAE;4BACtB2G,aAAaC,IAAI,CAACoC,MAAMhJ,WAAW;wBACrC;oBACF;oBAEA,OAAO2G;gBACT;YACF;QAEJ,EAAE,OAAOzF,OAAO;YACd,OAAO3B,mBAAmBoJ,mBAAmB,CAACxB,KAAKjG;QACrD;QAEA,IAAI,CAACR,QAAQ;YACX,OAAOnB,mBAAmBuJ,SAAS,CAAC3B;QACtC;QAEA,OAAO5H,mBAAmB0I,IAAI,CAACd,KAAKzG,OAAOG,SAAS;IACtD;AACF","ignoreList":[0]}
@@ -20,7 +20,7 @@ export function logStartInfo({ networkUrl, appUrl, envInfo, experimentalFeatures
20
20
  if (parts.length > 0) {
21
21
  versionSuffix = ` (${parts.join(', ')})`;
22
22
  }
23
- Log.bootstrap(`${bold(purple(`${Log.prefixes.ready} Next.js ${"16.0.7"}`))}${versionSuffix}`);
23
+ Log.bootstrap(`${bold(purple(`${Log.prefixes.ready} Next.js ${"16.0.8"}`))}${versionSuffix}`);
24
24
  if (appUrl) {
25
25
  Log.bootstrap(`- Local: ${appUrl}`);
26
26
  }
@@ -110,7 +110,7 @@ export async function getRequestHandlers({ dir, port, isDev, onDevServerCleanup,
110
110
  export async function startServer(serverOptions) {
111
111
  const { dir, isDev, hostname, minimalMode, allowRetry, keepAliveTimeout, selfSignedCertificate } = serverOptions;
112
112
  let { port } = serverOptions;
113
- process.title = `next-server (v${"16.0.7"})`;
113
+ process.title = `next-server (v${"16.0.8"})`;
114
114
  let handlersReady = ()=>{};
115
115
  let handlersError = ()=>{};
116
116
  let handlersPromise = new Promise((resolve, reject)=>{
@@ -1,5 +1,5 @@
1
1
  export function isStableBuild() {
2
- return !"16.0.7"?.includes('canary') && !process.env.__NEXT_TEST_MODE && !process.env.NEXT_PRIVATE_LOCAL_DEV;
2
+ return !"16.0.8"?.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){
@@ -231,7 +231,7 @@ class HotReloaderWebpack {
231
231
  this.previewProps = previewProps;
232
232
  this.rewrites = rewrites;
233
233
  this.hotReloaderSpan = (0, _trace.trace)('hot-reloader', undefined, {
234
- version: "16.0.7"
234
+ version: "16.0.8"
235
235
  });
236
236
  // Ensure the hotReloaderSpan is flushed immediately as it's the parentSpan for all processing
237
237
  // of the current `next dev` invocation.
@@ -277,11 +277,18 @@ async function getOriginalStackFrames({ isServer, isEdgeServer, isAppDirectory,
277
277
  value
278
278
  };
279
279
  }, (reason)=>{
280
+ let reasonStr;
281
+ try {
282
+ reasonStr = (0, _util.inspect)(reason, {
283
+ colors: false
284
+ });
285
+ } catch {
286
+ // Bun compatibility: inspect may throw on certain objects
287
+ reasonStr = String(reason);
288
+ }
280
289
  return {
281
290
  status: 'rejected',
282
- reason: (0, _util.inspect)(reason, {
283
- colors: false
284
- })
291
+ reason: reasonStr
285
292
  };
286
293
  })));
287
294
  (0, _shared.ignoreListAnonymousStackFramesIfSandwiched)(frameResponses);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/server/dev/middleware-webpack.ts"],"sourcesContent":["import { findSourceMap, type SourceMap } from '../../lib/module-loader-adapter'\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 as ModernSourceMapPayload\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":["createOriginalStackFrame","getIgnoredSources","getOriginalStackFrames","getOverlayMiddleware","getSourceMapMiddleware","shouldIgnoreSource","sourceURL","includes","startsWith","getModuleById","id","compilation","chunkGraph","modules","find","module","getModuleId","findModuleNotFoundFromError","errorMessage","match","getSourcePath","source","fileURLToPath","replace","findOriginalSourcePositionAndContent","sourceMap","position","consumer","SourceMapConsumer","cause","console","error","Error","file","sourcePosition","originalPositionFor","line","line1","column","column1","sourceContent","sourceContentFor","destroy","ignoreList","Set","moduleFilenames","sources","index","length","webpackSourceURL","formattedFilePath","formatFrameSourceFile","add","ignoredSources","map","url","ignored","has","indexOf","content","sourcesContent","isIgnoredSource","ignoredSource","findOriginalSourcePositionAndContentFromCompilation","moduleId","importedModule","buildInfo","importLocByPath","get","ignoredByDefault","rootDirectory","frame","moduleNotFound","result","type","undefined","moduleURL","sourcePath","filePath","path","resolve","resolvedFilePath","relative","traced","methodName","arguments","originalStackFrame","originalCodeFrame","getOriginalCodeFrame","getSourceMapFromCompilation","codeGenerationResult","codeGenerationResults","err","getSource","options","getCompilations","devirtualizeReactServerURL","nativeSourceMap","findSourceMap","sourceMapPayload","payload","findApplicableSourceMapPayload","isAbsolute","pathToFileURL","href","getSourceMapFromFile","isServer","isEdgeServer","isAppDirectory","frames","clientStats","serverStats","edgeServerStats","frameResponses","Promise","all","getOriginalStackFrame","then","value","status","reason","inspect","colors","ignoreListAnonymousStackFramesIfSandwiched","filename","compilations","push","defaultNormalizedStackFrameLocation","defaultStackFrame","sourceMapIgnoreListsEverything","originalStackFrameResponse","isSrcDir","req","res","next","pathname","searchParams","URL","method","middlewareResponse","badRequest","body","reject","data","on","chunk","JSON","parse","json","parseInt","getAll","filter","Boolean","openEditorResult","isAppRelativePath","relativeFilePath","appPath","join","openFileInEditor","internalServerError","found","notFound","noContent","stats"],"mappings":";;;;;;;;;;;;;;;;;;IAuLsBA,wBAAwB;eAAxBA;;IAnDNC,iBAAiB;eAAjBA;;IAiPMC,sBAAsB;eAAtBA;;IAkKNC,oBAAoB;eAApBA;;IAqGAC,sBAAsB;eAAtBA;;;qCA5nB8B;6DAC7B;qBAC4B;6BACX;sCACG;4BAO9B;8BAC0B;wBAS1B;oCAC4B;mCAQG;sBAEd;;;;;;AAExB,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,UAAWH,WAAWI,WAAW,CAACD,aAAYL;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,OAAOc,IAAAA,kBAAa,EAACD;IACvB;IACA,OAAOA,OAAOE,OAAO,CAAC,qDAAqD;AAC7E;AAEA;;CAEC,GACD,eAAeC,qCACbC,SAAiC,EACjCC,QAA0D;IAE1D,IAAIC;IACJ,IAAI;QACFA,WAAW,MAAM,IAAIC,8BAAiB,CAACH;IACzC,EAAE,OAAOI,OAAO;QACdC,QAAQC,KAAK,CACX,qBAGC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vC;QAEA,IAAIhH;QAEJ,IAAI;YACFA,SAAS,MAAMwE,UACb;gBACE5D,MAAM2F;gBACN,wCAAwC;gBACxCvF,OAAO;gBACPE,SAAS;YACX,GACA;gBACEwD,iBAAiB;oBACf,MAAM8B,eAAsC,EAAE;oBAE9C,KAAK,MAAMsC,SAAS;wBAClBrD;wBACAC;wBACAC;qBACD,CAAE;wBACD,IAAImD,yBAAAA,MAAOxJ,WAAW,EAAE;4BACtBkH,aAAaC,IAAI,CAACqC,MAAMxJ,WAAW;wBACrC;oBACF;oBAEA,OAAOkH;gBACT;YACF;QAEJ,EAAE,OAAO9F,OAAO;YACd,OAAO4G,sCAAkB,CAACoB,mBAAmB,CAAC1B,KAAKtG;QACrD;QAEA,IAAI,CAACV,QAAQ;YACX,OAAOsH,sCAAkB,CAACuB,SAAS,CAAC7B;QACtC;QAEA,OAAOM,sCAAkB,CAACS,IAAI,CAACf,KAAKhH,OAAOI,SAAS;IACtD;AACF","ignoreList":[0]}
1
+ {"version":3,"sources":["../../../src/server/dev/middleware-webpack.ts"],"sourcesContent":["import { findSourceMap, type SourceMap } from '../../lib/module-loader-adapter'\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 as ModernSourceMapPayload\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 let reasonStr: string\n try {\n reasonStr = inspect(reason, { colors: false })\n } catch {\n // Bun compatibility: inspect may throw on certain objects\n reasonStr = String(reason)\n }\n return {\n status: 'rejected',\n reason: reasonStr,\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":["createOriginalStackFrame","getIgnoredSources","getOriginalStackFrames","getOverlayMiddleware","getSourceMapMiddleware","shouldIgnoreSource","sourceURL","includes","startsWith","getModuleById","id","compilation","chunkGraph","modules","find","module","getModuleId","findModuleNotFoundFromError","errorMessage","match","getSourcePath","source","fileURLToPath","replace","findOriginalSourcePositionAndContent","sourceMap","position","consumer","SourceMapConsumer","cause","console","error","Error","file","sourcePosition","originalPositionFor","line","line1","column","column1","sourceContent","sourceContentFor","destroy","ignoreList","Set","moduleFilenames","sources","index","length","webpackSourceURL","formattedFilePath","formatFrameSourceFile","add","ignoredSources","map","url","ignored","has","indexOf","content","sourcesContent","isIgnoredSource","ignoredSource","findOriginalSourcePositionAndContentFromCompilation","moduleId","importedModule","buildInfo","importLocByPath","get","ignoredByDefault","rootDirectory","frame","moduleNotFound","result","type","undefined","moduleURL","sourcePath","filePath","path","resolve","resolvedFilePath","relative","traced","methodName","arguments","originalStackFrame","originalCodeFrame","getOriginalCodeFrame","getSourceMapFromCompilation","codeGenerationResult","codeGenerationResults","err","getSource","options","getCompilations","devirtualizeReactServerURL","nativeSourceMap","findSourceMap","sourceMapPayload","payload","findApplicableSourceMapPayload","isAbsolute","pathToFileURL","href","getSourceMapFromFile","isServer","isEdgeServer","isAppDirectory","frames","clientStats","serverStats","edgeServerStats","frameResponses","Promise","all","getOriginalStackFrame","then","value","status","reason","reasonStr","inspect","colors","String","ignoreListAnonymousStackFramesIfSandwiched","filename","compilations","push","defaultNormalizedStackFrameLocation","defaultStackFrame","sourceMapIgnoreListsEverything","originalStackFrameResponse","isSrcDir","req","res","next","pathname","searchParams","URL","method","middlewareResponse","badRequest","body","reject","data","on","chunk","JSON","parse","json","parseInt","getAll","filter","Boolean","openEditorResult","isAppRelativePath","relativeFilePath","appPath","join","openFileInEditor","internalServerError","found","notFound","noContent","stats"],"mappings":";;;;;;;;;;;;;;;;;;IAuLsBA,wBAAwB;eAAxBA;;IAnDNC,iBAAiB;eAAjBA;;IAiPMC,sBAAsB;eAAtBA;;IAyKNC,oBAAoB;eAApBA;;IAqGAC,sBAAsB;eAAtBA;;;qCAnoB8B;6DAC7B;qBAC4B;6BACX;sCACG;4BAO9B;8BAC0B;wBAS1B;oCAC4B;mCAQG;sBAEd;;;;;;AAExB,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,O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OAAOI,SAAS;IACtD;AACF","ignoreList":[0]}
@@ -88,7 +88,7 @@ function logStartInfo({ networkUrl, appUrl, envInfo, experimentalFeatures, logBu
88
88
  if (parts.length > 0) {
89
89
  versionSuffix = ` (${parts.join(', ')})`;
90
90
  }
91
- _log.bootstrap(`${(0, _picocolors.bold)((0, _picocolors.purple)(`${_log.prefixes.ready} Next.js ${"16.0.7"}`))}${versionSuffix}`);
91
+ _log.bootstrap(`${(0, _picocolors.bold)((0, _picocolors.purple)(`${_log.prefixes.ready} Next.js ${"16.0.8"}`))}${versionSuffix}`);
92
92
  if (appUrl) {
93
93
  _log.bootstrap(`- Local: ${appUrl}`);
94
94
  }
@@ -178,7 +178,7 @@ async function getRequestHandlers({ dir, port, isDev, onDevServerCleanup, server
178
178
  async function startServer(serverOptions) {
179
179
  const { dir, isDev, hostname, minimalMode, allowRetry, keepAliveTimeout, selfSignedCertificate } = serverOptions;
180
180
  let { port } = serverOptions;
181
- process.title = `next-server (v${"16.0.7"})`;
181
+ process.title = `next-server (v${"16.0.8"})`;
182
182
  let handlersReady = ()=>{};
183
183
  let handlersError = ()=>{};
184
184
  let handlersPromise = new Promise((resolve, reject)=>{
@@ -21,7 +21,7 @@ _export(exports, {
21
21
  }
22
22
  });
23
23
  function isStableBuild() {
24
- return !"16.0.7"?.includes('canary') && !process.env.__NEXT_TEST_MODE && !process.env.NEXT_PRIVATE_LOCAL_DEV;
24
+ return !"16.0.8"?.includes('canary') && !process.env.__NEXT_TEST_MODE && !process.env.NEXT_PRIVATE_LOCAL_DEV;
25
25
  }
26
26
  class CanaryOnlyConfigError extends Error {
27
27
  constructor(arg){
@@ -81,7 +81,7 @@ function getAnonymousMeta() {
81
81
  isWsl: _iswsl.default,
82
82
  isCI: _ciinfo.isCI,
83
83
  ciName: _ciinfo.isCI && _ciinfo.name || null,
84
- nextVersion: "16.0.7"
84
+ nextVersion: "16.0.8"
85
85
  };
86
86
  return traits;
87
87
  }
@@ -11,11 +11,11 @@ Object.defineProperty(exports, "eventCliSessionStopped", {
11
11
  const EVENT_VERSION = 'NEXT_CLI_SESSION_STOPPED';
12
12
  function eventCliSessionStopped(event) {
13
13
  // This should be an invariant, if it fails our build tooling is broken.
14
- if (typeof "16.0.7" !== 'string') {
14
+ if (typeof "16.0.8" !== 'string') {
15
15
  return [];
16
16
  }
17
17
  const payload = {
18
- nextVersion: "16.0.7",
18
+ nextVersion: "16.0.8",
19
19
  nodeVersion: process.version,
20
20
  cliCommand: event.cliCommand,
21
21
  durationMilliseconds: event.durationMilliseconds,
@@ -12,12 +12,12 @@ const EVENT_VERSION = 'NEXT_CLI_SESSION_STARTED';
12
12
  function eventCliSession(nextConfig, event) {
13
13
  var _nextConfig_experimental_staleTimes, _nextConfig_experimental_staleTimes1, _nextConfig_reactCompiler, _nextConfig_reactCompiler1;
14
14
  // This should be an invariant, if it fails our build tooling is broken.
15
- if (typeof "16.0.7" !== 'string') {
15
+ if (typeof "16.0.8" !== 'string') {
16
16
  return [];
17
17
  }
18
18
  const { images, i18n } = nextConfig || {};
19
19
  const payload = {
20
- nextVersion: "16.0.7",
20
+ nextVersion: "16.0.8",
21
21
  nodeVersion: process.version,
22
22
  cliCommand: event.cliCommand,
23
23
  isSrcDir: event.isSrcDir,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openuiai/next",
3
- "version": "16.0.7",
3
+ "version": "16.0.9",
4
4
  "description": "OpenNext.js - A development-focused fork of Next.js with Bun support",
5
5
  "main": "./dist/server/next.js",
6
6
  "license": "MIT",