next 15.0.4-canary.23 → 15.0.4-canary.24

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

Potentially problematic release.


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

Files changed (59) hide show
  1. package/dist/bin/next +1 -1
  2. package/dist/build/index.js +2 -2
  3. package/dist/build/swc/index.js +1 -1
  4. package/dist/build/webpack/plugins/wellknown-errors-plugin/parseNotFoundError.js +3 -3
  5. package/dist/build/webpack/plugins/wellknown-errors-plugin/parseNotFoundError.js.map +1 -1
  6. package/dist/build/webpack-config.js +2 -2
  7. package/dist/client/app-bootstrap.js +1 -1
  8. package/dist/client/components/react-dev-overlay/server/{middleware.js → middleware-webpack.js} +1 -1
  9. package/dist/client/components/react-dev-overlay/server/middleware-webpack.js.map +1 -0
  10. package/dist/client/index.js +1 -1
  11. package/dist/compiled/next-server/server.runtime.prod.js.map +1 -1
  12. package/dist/esm/build/index.js +2 -2
  13. package/dist/esm/build/swc/index.js +1 -1
  14. package/dist/esm/build/webpack/plugins/wellknown-errors-plugin/parseNotFoundError.js +1 -1
  15. package/dist/esm/build/webpack/plugins/wellknown-errors-plugin/parseNotFoundError.js.map +1 -1
  16. package/dist/esm/build/webpack-config.js +2 -2
  17. package/dist/esm/client/app-bootstrap.js +1 -1
  18. package/dist/esm/client/components/react-dev-overlay/server/{middleware.js → middleware-webpack.js} +1 -1
  19. package/dist/esm/client/components/react-dev-overlay/server/middleware-webpack.js.map +1 -0
  20. package/dist/esm/client/index.js +1 -1
  21. package/dist/esm/server/config.js +1 -1
  22. package/dist/esm/server/dev/hot-reloader-turbopack.js +1 -1
  23. package/dist/esm/server/dev/hot-reloader-webpack.js +2 -2
  24. package/dist/esm/server/dev/hot-reloader-webpack.js.map +1 -1
  25. package/dist/esm/server/image-optimizer.js +2 -2
  26. package/dist/esm/server/image-optimizer.js.map +1 -1
  27. package/dist/esm/server/lib/app-info-log.js +1 -1
  28. package/dist/esm/server/lib/router-utils/setup-dev-bundler.js +1 -1
  29. package/dist/esm/server/lib/router-utils/setup-dev-bundler.js.map +1 -1
  30. package/dist/esm/server/lib/start-server.js +1 -1
  31. package/dist/esm/server/patch-error-inspect.js +1 -1
  32. package/dist/esm/server/patch-error-inspect.js.map +1 -1
  33. package/dist/esm/server/web/sandbox/context.js +1 -1
  34. package/dist/esm/server/web/sandbox/context.js.map +1 -1
  35. package/dist/esm/server/web/sandbox/sandbox.js +1 -1
  36. package/dist/esm/server/web/sandbox/sandbox.js.map +1 -1
  37. package/dist/server/config.js +1 -1
  38. package/dist/server/dev/hot-reloader-turbopack.js +1 -1
  39. package/dist/server/dev/hot-reloader-webpack.js +4 -4
  40. package/dist/server/dev/hot-reloader-webpack.js.map +1 -1
  41. package/dist/server/image-optimizer.js +2 -2
  42. package/dist/server/image-optimizer.js.map +1 -1
  43. package/dist/server/lib/app-info-log.js +1 -1
  44. package/dist/server/lib/router-utils/setup-dev-bundler.js +5 -5
  45. package/dist/server/lib/router-utils/setup-dev-bundler.js.map +1 -1
  46. package/dist/server/lib/start-server.js +1 -1
  47. package/dist/server/patch-error-inspect.js +2 -2
  48. package/dist/server/patch-error-inspect.js.map +1 -1
  49. package/dist/server/web/sandbox/context.js +1 -1
  50. package/dist/server/web/sandbox/context.js.map +1 -1
  51. package/dist/server/web/sandbox/sandbox.js +1 -1
  52. package/dist/server/web/sandbox/sandbox.js.map +1 -1
  53. package/dist/telemetry/anonymous-meta.js +1 -1
  54. package/dist/telemetry/events/session-stopped.js +2 -2
  55. package/dist/telemetry/events/version.js +2 -2
  56. package/package.json +15 -15
  57. package/dist/client/components/react-dev-overlay/server/middleware.js.map +0 -1
  58. package/dist/esm/client/components/react-dev-overlay/server/middleware.js.map +0 -1
  59. /package/dist/client/components/react-dev-overlay/server/{middleware.d.ts → middleware-webpack.d.ts} +0 -0
@@ -284,7 +284,7 @@ export default async function build(dir, reactProductionProfiling = false, debug
284
284
  const nextBuildSpan = trace('next-build', undefined, {
285
285
  buildMode: experimentalBuildMode,
286
286
  isTurboBuild: String(turboNextBuild),
287
- version: "15.0.4-canary.23"
287
+ version: "15.0.4-canary.24"
288
288
  });
289
289
  NextBuildContext.nextBuildSpan = nextBuildSpan;
290
290
  NextBuildContext.dir = dir;
@@ -686,7 +686,7 @@ export default async function build(dir, reactProductionProfiling = false, debug
686
686
  // Files outside of the distDir can be "type": "module"
687
687
  await writeFileUtf8(path.join(distDir, 'package.json'), '{"type": "commonjs"}');
688
688
  // These are written to distDir, so they need to come after creating and cleaning distDr.
689
- await recordFrameworkVersion("15.0.4-canary.23");
689
+ await recordFrameworkVersion("15.0.4-canary.24");
690
690
  await updateBuildDiagnostics({
691
691
  buildStage: 'start'
692
692
  });
@@ -11,7 +11,7 @@ import { isDeepStrictEqual } from 'util';
11
11
  import { getDefineEnv } from '../webpack/plugins/define-env-plugin';
12
12
  import { getReactCompilerLoader } from '../get-babel-loader-config';
13
13
  import { TurbopackInternalError } from '../../server/dev/turbopack-utils';
14
- const nextVersion = "15.0.4-canary.23";
14
+ const nextVersion = "15.0.4-canary.24";
15
15
  const ArchName = arch();
16
16
  const PlatformName = platform();
17
17
  function infoLog(...args) {
@@ -1,6 +1,6 @@
1
1
  import { bold, cyan, green, red, yellow } from '../../../../lib/picocolors';
2
2
  import { SimpleWebpackError } from './simpleWebpackError';
3
- import { createOriginalStackFrame, getIgnoredSources } from '../../../../client/components/react-dev-overlay/server/middleware';
3
+ import { createOriginalStackFrame, getIgnoredSources } from '../../../../client/components/react-dev-overlay/server/middleware-webpack';
4
4
  // Based on https://github.com/webpack/webpack/blob/fcdd04a833943394bbb0a9eeb54a962a24cc7e41/lib/stats/DefaultStatsFactoryPlugin.js#L422-L431
5
5
  /*
6
6
  Copyright JS Foundation and other contributors
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/build/webpack/plugins/wellknown-errors-plugin/parseNotFoundError.ts"],"sourcesContent":["import { bold, cyan, green, red, yellow } from '../../../../lib/picocolors'\nimport { SimpleWebpackError } from './simpleWebpackError'\nimport {\n createOriginalStackFrame,\n getIgnoredSources,\n} from '../../../../client/components/react-dev-overlay/server/middleware'\nimport type { webpack } from 'next/dist/compiled/webpack/webpack'\n\n// Based on https://github.com/webpack/webpack/blob/fcdd04a833943394bbb0a9eeb54a962a24cc7e41/lib/stats/DefaultStatsFactoryPlugin.js#L422-L431\n/*\nCopyright JS Foundation and other contributors\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n*/\nfunction getModuleTrace(input: any, compilation: any) {\n const visitedModules = new Set()\n const moduleTrace = []\n let current = input.module\n while (current) {\n if (visitedModules.has(current)) break // circular (technically impossible, but who knows)\n visitedModules.add(current)\n const origin = compilation.moduleGraph.getIssuer(current)\n if (!origin) break\n moduleTrace.push({ origin, module: current })\n current = origin\n }\n\n return moduleTrace\n}\n\nasync function getSourceFrame(\n input: any,\n fileName: any,\n compilation: any\n): Promise<{ frame: string; lineNumber: string; column: string }> {\n try {\n const loc =\n input.loc || input.dependencies.map((d: any) => d.loc).filter(Boolean)[0]\n const module = input.module as webpack.Module\n const originalSource = module.originalSource()\n const sourceMap = originalSource?.map() ?? undefined\n\n if (sourceMap) {\n const moduleId = compilation.chunkGraph.getModuleId(module)\n\n const result = await createOriginalStackFrame({\n source: {\n type: 'bundle',\n sourceMap,\n ignoredSources: getIgnoredSources(sourceMap),\n compilation,\n moduleId,\n modulePath: fileName,\n },\n rootDirectory: compilation.options.context!,\n frame: {\n arguments: [],\n file: fileName,\n methodName: '',\n lineNumber: loc.start.line,\n column: loc.start.column,\n },\n })\n\n return {\n frame: result?.originalCodeFrame ?? '',\n lineNumber: result?.originalStackFrame?.lineNumber?.toString() ?? '',\n column: result?.originalStackFrame?.column?.toString() ?? '',\n }\n }\n } catch {}\n\n return { frame: '', lineNumber: '', column: '' }\n}\n\nfunction getFormattedFileName(\n fileName: string,\n module: any,\n lineNumber?: string,\n column?: string\n): string {\n if (\n module.loaders?.find((loader: any) =>\n /next-font-loader[/\\\\]index.js/.test(loader.loader)\n )\n ) {\n // Parse the query and get the path of the file where the font function was called.\n // provided by next-swc next-transform-font\n return JSON.parse(module.resourceResolveData.query.slice(1)).path\n } else {\n let formattedFileName: string = cyan(fileName)\n if (lineNumber && column) {\n formattedFileName += `:${yellow(lineNumber)}:${yellow(column)}`\n }\n\n return formattedFileName\n }\n}\n\nexport async function getNotFoundError(\n compilation: webpack.Compilation,\n input: any,\n fileName: string,\n module: any\n) {\n if (\n input.name !== 'ModuleNotFoundError' &&\n !(\n input.name === 'ModuleBuildError' &&\n /Error: Can't resolve '.+' in /.test(input.message)\n )\n ) {\n return false\n }\n\n try {\n const { frame, lineNumber, column } = await getSourceFrame(\n input,\n fileName,\n compilation\n )\n\n const errorMessage = input.error.message\n .replace(/ in '.*?'/, '')\n .replace(/Can't resolve '(.*)'/, `Can't resolve '${green('$1')}'`)\n\n const importTrace = () => {\n const moduleTrace = getModuleTrace(input, compilation)\n .map(({ origin }) =>\n origin.readableIdentifier(compilation.requestShortener)\n )\n .filter(\n (name) =>\n name &&\n !/next-(app|middleware|client-pages|route|flight-(client|server|client-entry))-loader/.test(\n name\n ) &&\n !/css-loader.+\\.js/.test(name)\n )\n if (moduleTrace.length === 0) return ''\n\n return `\\nImport trace for requested module:\\n${moduleTrace.join('\\n')}`\n }\n\n let message =\n red(bold('Module not found')) +\n `: ${errorMessage}` +\n '\\n' +\n frame +\n (frame !== '' ? '\\n' : '') +\n '\\nhttps://nextjs.org/docs/messages/module-not-found\\n' +\n importTrace()\n\n const formattedFileName = getFormattedFileName(\n fileName,\n module,\n lineNumber,\n column\n )\n\n return new SimpleWebpackError(formattedFileName, message)\n } catch (err) {\n // Don't fail on failure to resolve sourcemaps\n return input\n }\n}\n\nexport async function getImageError(\n compilation: any,\n input: any,\n err: Error\n): Promise<SimpleWebpackError | false> {\n if (err.name !== 'InvalidImageFormatError') {\n return false\n }\n\n const moduleTrace = getModuleTrace(input, compilation)\n const { origin, module } = moduleTrace[0] || {}\n if (!origin || !module) {\n return false\n }\n const page = origin.rawRequest.replace(/^private-next-pages/, './pages')\n const importedFile = module.rawRequest\n const source = origin.originalSource().buffer().toString('utf8') as string\n let lineNumber = -1\n source.split('\\n').some((line) => {\n lineNumber++\n return line.includes(importedFile)\n })\n return new SimpleWebpackError(\n `${cyan(page)}:${yellow(lineNumber.toString())}`,\n red(bold('Error')).concat(\n `: Image import \"${importedFile}\" is not a valid image file. The image may be corrupted or an unsupported format.`\n )\n )\n}\n"],"names":["bold","cyan","green","red","yellow","SimpleWebpackError","createOriginalStackFrame","getIgnoredSources","getModuleTrace","input","compilation","visitedModules","Set","moduleTrace","current","module","has","add","origin","moduleGraph","getIssuer","push","getSourceFrame","fileName","loc","dependencies","map","d","filter","Boolean","originalSource","sourceMap","undefined","result","moduleId","chunkGraph","getModuleId","source","type","ignoredSources","modulePath","rootDirectory","options","context","frame","arguments","file","methodName","lineNumber","start","line","column","originalCodeFrame","originalStackFrame","toString","getFormattedFileName","loaders","find","loader","test","JSON","parse","resourceResolveData","query","slice","path","formattedFileName","getNotFoundError","name","message","errorMessage","error","replace","importTrace","readableIdentifier","requestShortener","length","join","err","getImageError","page","rawRequest","importedFile","buffer","split","some","includes","concat"],"mappings":"AAAA,SAASA,IAAI,EAAEC,IAAI,EAAEC,KAAK,EAAEC,GAAG,EAAEC,MAAM,QAAQ,6BAA4B;AAC3E,SAASC,kBAAkB,QAAQ,uBAAsB;AACzD,SACEC,wBAAwB,EACxBC,iBAAiB,QACZ,oEAAmE;AAG1E,6IAA6I;AAC7I;;;;;;;;;;;;;;;;;;;;;;AAsBA,GACA,SAASC,eAAeC,KAAU,EAAEC,WAAgB;IAClD,MAAMC,iBAAiB,IAAIC;IAC3B,MAAMC,cAAc,EAAE;IACtB,IAAIC,UAAUL,MAAMM,MAAM;IAC1B,MAAOD,QAAS;QACd,IAAIH,eAAeK,GAAG,CAACF,UAAU,OAAM,mDAAmD;QAC1FH,eAAeM,GAAG,CAACH;QACnB,MAAMI,SAASR,YAAYS,WAAW,CAACC,SAAS,CAACN;QACjD,IAAI,CAACI,QAAQ;QACbL,YAAYQ,IAAI,CAAC;YAAEH;YAAQH,QAAQD;QAAQ;QAC3CA,UAAUI;IACZ;IAEA,OAAOL;AACT;AAEA,eAAeS,eACbb,KAAU,EACVc,QAAa,EACbb,WAAgB;IAEhB,IAAI;QACF,MAAMc,MACJf,MAAMe,GAAG,IAAIf,MAAMgB,YAAY,CAACC,GAAG,CAAC,CAACC,IAAWA,EAAEH,GAAG,EAAEI,MAAM,CAACC,QAAQ,CAAC,EAAE;QAC3E,MAAMd,SAASN,MAAMM,MAAM;QAC3B,MAAMe,iBAAiBf,OAAOe,cAAc;QAC5C,MAAMC,YAAYD,CAAAA,kCAAAA,eAAgBJ,GAAG,OAAMM;QAE3C,IAAID,WAAW;gBAwBCE,uCAAAA,4BACJA,mCAAAA;YAxBV,MAAMC,WAAWxB,YAAYyB,UAAU,CAACC,WAAW,CAACrB;YAEpD,MAAMkB,SAAS,MAAM3B,yBAAyB;gBAC5C+B,QAAQ;oBACNC,MAA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AAMvD,cAAcL,eAAeC,OAAOC;IAC1C,MAAM,EAAEQ,MAAM,EAAEH,MAAM,EAAE,GAAGF,WAAW,CAAC,EAAE,IAAI,CAAC;IAC9C,IAAI,CAACK,UAAU,CAACH,QAAQ;QACtB,OAAO;IACT;IACA,MAAMiE,OAAO9D,OAAO+D,UAAU,CAACT,OAAO,CAAC,uBAAuB;IAC9D,MAAMU,eAAenE,OAAOkE,UAAU;IACtC,MAAM5C,SAASnB,OAAOY,cAAc,GAAGqD,MAAM,GAAG7B,QAAQ,CAAC;IACzD,IAAIN,aAAa,CAAC;IAClBX,OAAO+C,KAAK,CAAC,MAAMC,IAAI,CAAC,CAACnC;QACvBF;QACA,OAAOE,KAAKoC,QAAQ,CAACJ;IACvB;IACA,OAAO,IAAI7E,mBACT,GAAGJ,KAAK+E,MAAM,CAAC,EAAE5E,OAAO4C,WAAWM,QAAQ,KAAK,EAChDnD,IAAIH,KAAK,UAAUuF,MAAM,CACvB,CAAC,gBAAgB,EAAEL,aAAa,iFAAiF,CAAC;AAGxH"}
1
+ {"version":3,"sources":["../../../../../src/build/webpack/plugins/wellknown-errors-plugin/parseNotFoundError.ts"],"sourcesContent":["import { bold, cyan, green, red, yellow } from '../../../../lib/picocolors'\nimport { SimpleWebpackError } from './simpleWebpackError'\nimport {\n createOriginalStackFrame,\n getIgnoredSources,\n} from '../../../../client/components/react-dev-overlay/server/middleware-webpack'\nimport type { webpack } from 'next/dist/compiled/webpack/webpack'\n\n// Based on https://github.com/webpack/webpack/blob/fcdd04a833943394bbb0a9eeb54a962a24cc7e41/lib/stats/DefaultStatsFactoryPlugin.js#L422-L431\n/*\nCopyright JS Foundation and other contributors\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n*/\nfunction getModuleTrace(input: any, compilation: any) {\n const visitedModules = new Set()\n const moduleTrace = []\n let current = input.module\n while (current) {\n if (visitedModules.has(current)) break // circular (technically impossible, but who knows)\n visitedModules.add(current)\n const origin = compilation.moduleGraph.getIssuer(current)\n if (!origin) break\n moduleTrace.push({ origin, module: current })\n current = origin\n }\n\n return moduleTrace\n}\n\nasync function getSourceFrame(\n input: any,\n fileName: any,\n compilation: any\n): Promise<{ frame: string; lineNumber: string; column: string }> {\n try {\n const loc =\n input.loc || input.dependencies.map((d: any) => d.loc).filter(Boolean)[0]\n const module = input.module as webpack.Module\n const originalSource = module.originalSource()\n const sourceMap = originalSource?.map() ?? undefined\n\n if (sourceMap) {\n const moduleId = compilation.chunkGraph.getModuleId(module)\n\n const result = await createOriginalStackFrame({\n source: {\n type: 'bundle',\n sourceMap,\n ignoredSources: getIgnoredSources(sourceMap),\n compilation,\n moduleId,\n modulePath: fileName,\n },\n rootDirectory: compilation.options.context!,\n frame: {\n arguments: [],\n file: fileName,\n methodName: '',\n lineNumber: loc.start.line,\n column: loc.start.column,\n },\n })\n\n return {\n frame: result?.originalCodeFrame ?? '',\n lineNumber: result?.originalStackFrame?.lineNumber?.toString() ?? '',\n column: result?.originalStackFrame?.column?.toString() ?? '',\n }\n }\n } catch {}\n\n return { frame: '', lineNumber: '', column: '' }\n}\n\nfunction getFormattedFileName(\n fileName: string,\n module: any,\n lineNumber?: string,\n column?: string\n): string {\n if (\n module.loaders?.find((loader: any) =>\n /next-font-loader[/\\\\]index.js/.test(loader.loader)\n )\n ) {\n // Parse the query and get the path of the file where the font function was called.\n // provided by next-swc next-transform-font\n return JSON.parse(module.resourceResolveData.query.slice(1)).path\n } else {\n let formattedFileName: string = cyan(fileName)\n if (lineNumber && column) {\n formattedFileName += `:${yellow(lineNumber)}:${yellow(column)}`\n }\n\n return formattedFileName\n }\n}\n\nexport async function getNotFoundError(\n compilation: webpack.Compilation,\n input: any,\n fileName: string,\n module: any\n) {\n if (\n input.name !== 'ModuleNotFoundError' &&\n !(\n input.name === 'ModuleBuildError' &&\n /Error: Can't resolve '.+' in /.test(input.message)\n )\n ) {\n return false\n }\n\n try {\n const { frame, lineNumber, column } = await getSourceFrame(\n input,\n fileName,\n compilation\n )\n\n const errorMessage = input.error.message\n .replace(/ in '.*?'/, '')\n .replace(/Can't resolve '(.*)'/, `Can't resolve '${green('$1')}'`)\n\n const importTrace = () => {\n const moduleTrace = getModuleTrace(input, compilation)\n .map(({ origin }) =>\n origin.readableIdentifier(compilation.requestShortener)\n )\n .filter(\n (name) =>\n name &&\n !/next-(app|middleware|client-pages|route|flight-(client|server|client-entry))-loader/.test(\n name\n ) &&\n !/css-loader.+\\.js/.test(name)\n )\n if (moduleTrace.length === 0) return ''\n\n return `\\nImport trace for requested module:\\n${moduleTrace.join('\\n')}`\n }\n\n let message =\n red(bold('Module not found')) +\n `: ${errorMessage}` +\n '\\n' +\n frame +\n (frame !== '' ? '\\n' : '') +\n '\\nhttps://nextjs.org/docs/messages/module-not-found\\n' +\n importTrace()\n\n const formattedFileName = getFormattedFileName(\n fileName,\n module,\n lineNumber,\n column\n )\n\n return new SimpleWebpackError(formattedFileName, message)\n } catch (err) {\n // Don't fail on failure to resolve sourcemaps\n return input\n }\n}\n\nexport async function getImageError(\n compilation: any,\n input: any,\n err: Error\n): Promise<SimpleWebpackError | false> {\n if (err.name !== 'InvalidImageFormatError') {\n return false\n }\n\n const moduleTrace = getModuleTrace(input, compilation)\n const { origin, module } = moduleTrace[0] || {}\n if (!origin || !module) {\n return false\n }\n const page = origin.rawRequest.replace(/^private-next-pages/, './pages')\n const importedFile = module.rawRequest\n const source = origin.originalSource().buffer().toString('utf8') as string\n let lineNumber = -1\n source.split('\\n').some((line) => {\n lineNumber++\n return line.includes(importedFile)\n })\n return new SimpleWebpackError(\n `${cyan(page)}:${yellow(lineNumber.toString())}`,\n red(bold('Error')).concat(\n `: Image import \"${importedFile}\" is not a valid image file. The image may be corrupted or an unsupported format.`\n )\n )\n}\n"],"names":["bold","cyan","green","red","yellow","SimpleWebpackError","createOriginalStackFrame","getIgnoredSources","getModuleTrace","input","compilation","visitedModules","Set","moduleTrace","current","module","has","add","origin","moduleGraph","getIssuer","push","getSourceFrame","fileName","loc","dependencies","map","d","filter","Boolean","originalSource","sourceMap","undefined","result","moduleId","chunkGraph","getModuleId","source","type","ignoredSources","modulePath","rootDirectory","options","context","frame","arguments","file","methodName","lineNumber","start","line","column","originalCodeFrame","originalStackFrame","toString","getFormattedFileName","loaders","find","loader","test","JSON","parse","resourceResolveData","query","slice","path","formattedFileName","getNotFoundError","name","message","errorMessage","error","replace","importTrace","readableIdentifier","requestShortener","length","join","err","getImageError","page","rawRequest","importedFile","buffer","split","some","includes","concat"],"mappings":"AAAA,SAASA,IAAI,EAAEC,IAAI,EAAEC,KAAK,EAAEC,GAAG,EAAEC,MAAM,QAAQ,6BAA4B;AAC3E,SAASC,kBAAkB,QAAQ,uBAAsB;AACzD,SACEC,wBAAwB,EACxBC,iBAAiB,QACZ,4EAA2E;AAGlF,6IAA6I;AAC7I;;;;;;;;;;;;;;;;;;;;;;AAsBA,GACA,SAASC,eAAeC,KAAU,EAAEC,WAAgB;IAClD,MAAMC,iBAAiB,IAAIC;IAC3B,MAAMC,cAAc,EAAE;IACtB,IAAIC,UAAUL,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KoC,QAAQ,CAACJ;IACvB;IACA,OAAO,IAAI7E,mBACT,GAAGJ,KAAK+E,MAAM,CAAC,EAAE5E,OAAO4C,WAAWM,QAAQ,KAAK,EAChDnD,IAAIH,KAAK,UAAUuF,MAAM,CACvB,CAAC,gBAAgB,EAAEL,aAAa,iFAAiF,CAAC;AAGxH"}
@@ -1403,7 +1403,7 @@ export default async function getBaseWebpackConfig(dir, { buildId, encryptionKey
1403
1403
  isClient && new CopyFilePlugin({
1404
1404
  // file path to build output of `@next/polyfill-nomodule`
1405
1405
  filePath: require.resolve('./polyfills/polyfill-nomodule'),
1406
- cacheKey: "15.0.4-canary.23",
1406
+ cacheKey: "15.0.4-canary.24",
1407
1407
  name: `static/chunks/polyfills${dev ? '' : '-[hash]'}.js`,
1408
1408
  minimize: false,
1409
1409
  info: {
@@ -1632,7 +1632,7 @@ export default async function getBaseWebpackConfig(dir, { buildId, encryptionKey
1632
1632
  // - Next.js location on disk (some loaders use absolute paths and some resolve options depend on absolute paths)
1633
1633
  // - Next.js version
1634
1634
  // - next.config.js keys that affect compilation
1635
- version: `${__dirname}|${"15.0.4-canary.23"}|${configVars}`,
1635
+ version: `${__dirname}|${"15.0.4-canary.24"}|${configVars}`,
1636
1636
  cacheDirectory: path.join(distDir, 'cache', 'webpack'),
1637
1637
  // For production builds, it's more efficient to compress all cache files together instead of compression each one individually.
1638
1638
  // So we disable compression here and allow the build runner to take care of compressing the cache as a whole.
@@ -3,7 +3,7 @@
3
3
  * sure the following scripts are executed in the correct order:
4
4
  * - Polyfills
5
5
  * - next/script with `beforeInteractive` strategy
6
- */ const version = "15.0.4-canary.23";
6
+ */ const version = "15.0.4-canary.24";
7
7
  window.next = {
8
8
  version,
9
9
  appDir: true
@@ -361,4 +361,4 @@ export function getSourceMapMiddleware(options) {
361
361
  };
362
362
  }
363
363
 
364
- //# sourceMappingURL=middleware.js.map
364
+ //# sourceMappingURL=middleware-webpack.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/client/components/react-dev-overlay/server/middleware-webpack.ts"],"sourcesContent":["import { constants as FS, promises as fs } from 'fs'\nimport path from 'path'\nimport url from 'url'\nimport { SourceMapConsumer } from 'next/dist/compiled/source-map08'\nimport type { StackFrame } from 'next/dist/compiled/stacktrace-parser'\nimport { getSourceMapFromFile } from '../internal/helpers/get-source-map-from-file'\nimport { launchEditor } from '../internal/helpers/launchEditor'\nimport {\n badRequest,\n findSourcePackage,\n getOriginalCodeFrame,\n internalServerError,\n json,\n noContent,\n type OriginalStackFrameResponse,\n} from './shared'\nimport { NEXT_PROJECT_ROOT } from '../../../../build/next-dir-paths'\nexport { getServerError } from '../internal/helpers/node-stack-frames'\nexport { parseStack } from '../internal/helpers/parse-stack'\nexport { getSourceMapFromFile }\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 '../internal/helpers/webpack-module-path'\nimport type { MappedPosition } from 'source-map'\n\nfunction shouldIgnorePath(modulePath: string): boolean {\n return (\n modulePath.includes('node_modules') ||\n // Only relevant for when Next.js is symlinked e.g. in the Next.js monorepo\n modulePath.includes('next/dist')\n )\n}\n\ntype IgnoredSources = Array<{ url: string; ignored: boolean }>\n\nexport interface IgnorableStackFrame extends StackFrame {\n ignored: boolean\n}\n\ntype SourceAttributes = {\n sourcePosition: NullableMappedPosition\n sourceContent: string | null\n}\n\ntype Source =\n | {\n type: 'file'\n sourceMap: RawSourceMap\n ignoredSources: IgnoredSources\n modulePath: string\n }\n | {\n type: 'bundle'\n sourceMap: RawSourceMap\n ignoredSources: IgnoredSources\n compilation: webpack.Compilation\n moduleId: string\n modulePath: 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 return source.replace(/^(webpack:\\/\\/\\/|webpack:\\/\\/|webpack:\\/\\/_N_E\\/)/, '')\n}\n\nasync function findOriginalSourcePositionAndContent(\n sourceMap: RawSourceMap,\n position: { line: number; column: number | null }\n): Promise<SourceAttributes | null> {\n const consumer = await new SourceMapConsumer(sourceMap)\n try {\n const sourcePosition = consumer.originalPositionFor({\n line: position.line,\n column: position.column ?? 0,\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(sourceMap: RawSourceMap): IgnoredSources {\n const ignoreList = new Set<number>()\n const moduleFilenames = sourceMap?.sources ?? []\n\n for (let index = 0; index < moduleFilenames.length; index++) {\n // bundlerFilePath case: webpack://./app/page.tsx\n const bundlerFilePath = moduleFilenames[index]\n // Format the path to the normal file path\n const formattedFilePath = formatFrameSourceFile(bundlerFilePath)\n if (shouldIgnorePath(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 createStackFrame(searchParams: URLSearchParams) {\n const file = searchParams.get('file') as string\n return {\n file,\n methodName: searchParams.get('methodName') as string,\n lineNumber: parseInt(searchParams.get('lineNumber') ?? '0', 10) || 0,\n column: parseInt(searchParams.get('column') ?? '0', 10) || 0,\n arguments: searchParams.getAll('arguments').filter(Boolean),\n } satisfies StackFrame\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 source,\n rootDirectory,\n frame,\n errorMessage,\n}: {\n source: Source\n rootDirectory: string\n frame: StackFrame\n errorMessage?: string\n}): Promise<OriginalStackFrameResponse | null> {\n const { lineNumber, column } = frame\n const moduleNotFound = findModuleNotFoundFromError(errorMessage)\n const result = await (async () => {\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 // This returns 1-based lines and 0-based columns\n return await findOriginalSourcePositionAndContent(source.sourceMap, {\n line: lineNumber ?? 1,\n column,\n })\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 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 shouldIgnorePath(source.modulePath)\n\n const sourcePath = getSourcePath(\n // When sourcePosition.source is the loader path the modulePath is generally better.\n (sourcePosition.source!.includes('|')\n ? source.modulePath\n : sourcePosition.source) || source.modulePath\n )\n const filePath = path.resolve(rootDirectory, sourcePath)\n\n const resolvedFilePath = sourceContent\n ? path.relative(rootDirectory, filePath)\n : sourcePosition.source\n\n const traced: IgnorableStackFrame = {\n file: resolvedFilePath,\n lineNumber: sourcePosition.line,\n column: (sourcePosition.column ?? 0) + 1,\n methodName:\n sourcePosition.name ||\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 sourcePackage: findSourcePackage(traced),\n }\n}\n\nexport async 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 filename: string,\n options: {\n getCompilations: () => webpack.Compilation[]\n }\n): Promise<Source | undefined> {\n const { getCompilations } = options\n\n if (path.isAbsolute(filename)) {\n filename = url.pathToFileURL(filename).href\n }\n\n if (filename.startsWith('file:')) {\n const sourceMap = await getSourceMapFromFile(filename)\n return sourceMap\n ? {\n type: 'file',\n sourceMap,\n ignoredSources: getIgnoredSources(sourceMap),\n modulePath: filename.replace(/^file:\\/\\//, ''),\n }\n : undefined\n }\n\n // webpack-internal:///./src/hello.tsx => ./src/hello.tsx\n // rsc://React/Server/webpack-internal:///(rsc)/./src/hello.tsx?42 => (rsc)/./src/hello.tsx\n // webpack://_N_E/./src/hello.tsx => ./src/hello.tsx\n const moduleId = filename\n .replace(\n /^(rsc:\\/\\/React\\/[^/]+\\/)?(webpack-internal:\\/\\/\\/|webpack:\\/\\/(_N_E\\/)?)/,\n ''\n )\n .replace(/\\?\\d+$/, '')\n\n // (rsc)/./src/hello.tsx => ./src/hello.tsx\n const modulePath = moduleId.replace(/^(\\(.*\\)\\/?)/, '')\n\n for (const compilation of getCompilations()) {\n // TODO: `ignoreList`\n const sourceMap = await getSourceMapFromCompilation(moduleId, compilation)\n const 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 bundlerFilePath = moduleFilenames[index]\n // Format the path to the normal file path\n const formattedFilePath = formatFrameSourceFile(bundlerFilePath)\n if (shouldIgnorePath(formattedFilePath)) {\n ignoreList.push(index)\n }\n }\n\n if (sourceMap) {\n const ignoredSources = getIgnoredSources(sourceMap)\n return {\n type: 'bundle',\n sourceMap,\n compilation,\n moduleId,\n modulePath,\n ignoredSources,\n }\n }\n }\n\n return undefined\n}\n\nexport function getOverlayMiddleware(options: {\n rootDirectory: string\n clientStats: () => webpack.Stats | null\n serverStats: () => webpack.Stats | null\n edgeServerStats: () => webpack.Stats | null\n}) {\n const { rootDirectory, 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_original-stack-frame') {\n const isServer = searchParams.get('isServer') === 'true'\n const isEdgeServer = searchParams.get('isEdgeServer') === 'true'\n const isAppDirectory = searchParams.get('isAppDirectory') === 'true'\n const frame = createStackFrame(searchParams)\n const formattedFilePath = formatFrameSourceFile(frame.file)\n const filePath = path.join(rootDirectory, formattedFilePath)\n const isNextjsSource = filePath.startsWith(NEXT_PROJECT_ROOT)\n\n let sourcePackage = findSourcePackage(frame)\n let source: Source | undefined\n\n if (isNextjsSource) {\n sourcePackage = 'next'\n return json(res, { sourcePackage })\n }\n\n try {\n source = await getSource(frame.file, {\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 } catch (err) {\n console.error('Failed to get source map:', err)\n return internalServerError(res)\n }\n\n if (!source) {\n if (sourcePackage) return json(res, { sourcePackage })\n return noContent(res)\n }\n\n try {\n const originalStackFrameResponse = await createOriginalStackFrame({\n frame,\n source,\n rootDirectory,\n })\n\n if (!originalStackFrameResponse) {\n if (sourcePackage) return json(res, { sourcePackage })\n return noContent(res)\n }\n\n return json(res, originalStackFrameResponse)\n } catch (err) {\n console.log('Failed to parse source map:', err)\n return internalServerError(res)\n }\n } else if (pathname === '/__nextjs_launch-editor') {\n const frame = createStackFrame(searchParams)\n\n if (!frame.file) return badRequest(res)\n\n // frame files may start with their webpack layer, like (middleware)/middleware.js\n const filePath = path.resolve(\n rootDirectory,\n frame.file.replace(/^\\([^)]+\\)\\//, '')\n )\n const fileExists = await fs.access(filePath, FS.F_OK).then(\n () => true,\n () => false\n )\n if (!fileExists) return noContent(res)\n\n try {\n await launchEditor(filePath, frame.lineNumber, frame.column ?? 1)\n } catch (err) {\n console.log('Failed to launch editor:', err)\n return internalServerError(res)\n }\n\n return 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 badRequest(res)\n }\n\n let source: Source | undefined\n\n try {\n source = await getSource(filename, {\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 } catch (error) {\n console.error('Failed to get source map:', error)\n\n return internalServerError(res)\n }\n\n if (!source) {\n return noContent(res)\n }\n\n return json(res, source.sourceMap)\n }\n}\n"],"names":["constants","FS","promises","fs","path","url","SourceMapConsumer","getSourceMapFromFile","launchEditor","badRequest","findSourcePackage","getOriginalCodeFrame","internalServerError","json","noContent","NEXT_PROJECT_ROOT","getServerError","parseStack","formatFrameSourceFile","shouldIgnorePath","modulePath","includes","getModuleById","id","compilation","chunkGraph","modules","find","module","getModuleId","findModuleNotFoundFromError","errorMessage","match","getSourcePath","source","replace","findOriginalSourcePositionAndContent","sourceMap","position","consumer","sourcePosition","originalPositionFor","line","column","sourceContent","sourceContentFor","destroy","getIgnoredSources","ignoreList","Set","moduleFilenames","sources","index","length","bundlerFilePath","formattedFilePath","add","ignoredSources","map","ignored","has","indexOf","content","sourcesContent","isIgnoredSource","ignoredSource","createStackFrame","searchParams","file","get","methodName","lineNumber","parseInt","arguments","getAll","filter","Boolean","findOriginalSourcePositionAndContentFromCompilation","moduleId","importedModule","buildInfo","importLocByPath","createOriginalStackFrame","rootDirectory","frame","moduleNotFound","result","type","undefined","sourcePath","filePath","resolve","resolvedFilePath","relative","traced","name","originalStackFrame","originalCodeFrame","sourcePackage","getSourceMapFromCompilation","codeGenerationResult","codeGenerationResults","err","console","error","getSource","filename","options","getCompilations","isAbsolute","pathToFileURL","href","startsWith","push","getOverlayMiddleware","clientStats","serverStats","edgeServerStats","req","res","next","pathname","URL","isServer","isEdgeServer","isAppDirectory","join","isNextjsSource","compilations","originalStackFrameResponse","log","fileExists","access","F_OK","then","getSourceMapMiddleware","stats"],"mappings":"AAAA,SAASA,aAAaC,EAAE,EAAEC,YAAYC,EAAE,QAAQ,KAAI;AACpD,OAAOC,UAAU,OAAM;AACvB,OAAOC,SAAS,MAAK;AACrB,SAASC,iBAAiB,QAAQ,kCAAiC;AAEnE,SAASC,oBAAoB,QAAQ,+CAA8C;AACnF,SAASC,YAAY,QAAQ,mCAAkC;AAC/D,SACEC,UAAU,EACVC,iBAAiB,EACjBC,oBAAoB,EACpBC,mBAAmB,EACnBC,IAAI,EACJC,SAAS,QAEJ,WAAU;AACjB,SAASC,iBAAiB,QAAQ,mCAAkC;AACpE,SAASC,cAAc,QAAQ,wCAAuC;AACtE,SAASC,UAAU,QAAQ,kCAAiC;AAC5D,SAASV,oBAAoB,GAAE;AAQ/B,SAASW,qBAAqB,QAAQ,0CAAyC;AAG/E,SAASC,iBAAiBC,UAAkB;IAC1C,OACEA,WAAWC,QAAQ,CAAC,mBACpB,2EAA2E;IAC3ED,WAAWC,QAAQ,CAAC;AAExB;AA6BA,SAASC,cACPC,EAAsB,EACtBC,WAAgC;IAEhC,MAAM,EAAEC,UAAU,EAAEC,OAAO,EAAE,GAAGF;IAEhC,OAAO;WAAIE;KAAQ,CAACC,IAAI,CAAC,CAACC,SAAWH,WAAWI,WAAW,CAACD,YAAYL;AAC1E;AAEA,SAASO,4BAA4BC,YAAgC;QAC5DA;IAAP,OAAOA,iCAAAA,sBAAAA,aAAcC,KAAK,CAAC,wCAApBD,mBAAyC,CAAC,EAAE;AACrD;AAEA,SAASE,cAAcC,MAAc;IACnC,OAAOA,OAAOC,OAAO,CAAC,qDAAqD;AAC7E;AAEA,eAAeC,qCACbC,SAAuB,EACvBC,QAAiD;IAEjD,MAAMC,WAAW,MAAM,IAAIjC,kBAAkB+B;IAC7C,IAAI;YAGQC;QAFV,MAAME,iBAAi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,MAAOhH,WAAW,EAAE;4BACtBwG,aAAaf,IAAI,CAACuB,MAAMhH,WAAW;wBACrC;oBACF;oBAEA,OAAOwG;gBACT;YACF;QACF,EAAE,OAAOxB,OAAO;YACdD,QAAQC,KAAK,CAAC,6BAA6BA;YAE3C,OAAO5F,oBAAoB2G;QAC7B;QAEA,IAAI,CAACrF,QAAQ;YACX,OAAOpB,UAAUyG;QACnB;QAEA,OAAO1G,KAAK0G,KAAKrF,OAAOG,SAAS;IACnC;AACF"}
@@ -26,7 +26,7 @@ import { SearchParamsContext, PathParamsContext } from '../shared/lib/hooks-clie
26
26
  import { onRecoverableError } from './react-client-callbacks/shared';
27
27
  import tracer from './tracing/tracer';
28
28
  import reportToSocket from './tracing/report-to-socket';
29
- export const version = "15.0.4-canary.23";
29
+ export const version = "15.0.4-canary.24";
30
30
  export let router;
31
31
  export const emitter = mitt();
32
32
  const looseToArray = (input)=>[].slice.call(input);
@@ -155,7 +155,7 @@ function assignDefaults(dir, userConfig, silent) {
155
155
  if (((_result_experimental = result.experimental) == null ? void 0 : _result_experimental.allowDevelopmentBuild) && process.env.NODE_ENV !== 'development') {
156
156
  throw new Error(`The experimental.allowDevelopmentBuild option requires NODE_ENV to be explicitly set to 'development'.`);
157
157
  }
158
- if (!((_process_env___NEXT_VERSION = "15.0.4-canary.23") == null ? void 0 : _process_env___NEXT_VERSION.includes('canary')) && !process.env.__NEXT_TEST_MODE && !process.env.NEXT_PRIVATE_SKIP_CANARY_CHECK) {
158
+ if (!((_process_env___NEXT_VERSION = "15.0.4-canary.24") == null ? void 0 : _process_env___NEXT_VERSION.includes('canary')) && !process.env.__NEXT_TEST_MODE && !process.env.NEXT_PRIVATE_SKIP_CANARY_CHECK) {
159
159
  var _result_experimental7, _result_experimental8, _result_experimental_turbo3, _result_experimental9, _result_experimental10;
160
160
  // Prevents usage of certain experimental features outside of canary
161
161
  if ((_result_experimental7 = result.experimental) == null ? void 0 : _result_experimental7.ppr) {
@@ -48,7 +48,7 @@ export async function createHotReloaderTurbopack(opts, serverFields, distDir, re
48
48
  }
49
49
  const hasRewrites = opts.fsChecker.rewrites.afterFiles.length > 0 || opts.fsChecker.rewrites.beforeFiles.length > 0 || opts.fsChecker.rewrites.fallback.length > 0;
50
50
  const hotReloaderSpan = trace('hot-reloader', undefined, {
51
- version: "15.0.4-canary.23"
51
+ version: "15.0.4-canary.24"
52
52
  });
53
53
  // Ensure the hotReloaderSpan is flushed immediately as it's the parentSpan for all processing
54
54
  // of the current `next dev` invocation.
@@ -1,5 +1,5 @@
1
1
  import { webpack, StringXor } from 'next/dist/compiled/webpack/webpack';
2
- import { getOverlayMiddleware, getSourceMapMiddleware } from '../../client/components/react-dev-overlay/server/middleware';
2
+ import { getOverlayMiddleware, getSourceMapMiddleware } from '../../client/components/react-dev-overlay/server/middleware-webpack';
3
3
  import { WebpackHotMiddleware } from './hot-middleware';
4
4
  import { join, relative, isAbsolute, posix } from 'path';
5
5
  import { createEntrypoints, createPagesMapping, finalizeEntrypoint, getClientEntry, getEdgeServerEntry, getAppEntry, runDependingOnPageType, getStaticInfoIncludingLayouts, getInstrumentationEntry } from '../../build/entries';
@@ -184,7 +184,7 @@ export default class HotReloaderWebpack {
184
184
  this.previewProps = previewProps;
185
185
  this.rewrites = rewrites;
186
186
  this.hotReloaderSpan = trace('hot-reloader', undefined, {
187
- version: "15.0.4-canary.23"
187
+ version: "15.0.4-canary.24"
188
188
  });
189
189
  // Ensure the hotReloaderSpan is flushed immediately as it's the parentSpan for all processing
190
190
  // of the current `next dev` invocation.