next 15.4.2-canary.22 → 15.4.2-canary.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/dist/bin/next +1 -1
  2. package/dist/build/index.js +2 -2
  3. package/dist/build/swc/generated-native.d.ts +0 -33
  4. package/dist/build/swc/index.js +1 -11
  5. package/dist/build/swc/index.js.map +1 -1
  6. package/dist/build/swc/types.d.ts +1 -7
  7. package/dist/build/webpack-config.js +2 -2
  8. package/dist/client/app-bootstrap.js +1 -1
  9. package/dist/client/index.js +1 -1
  10. package/dist/compiled/@vercel/og/emoji/index.d.ts +15 -0
  11. package/dist/compiled/@vercel/og/figma/index.d.ts +7 -0
  12. package/dist/compiled/@vercel/og/index.edge.d.ts +5 -9
  13. package/dist/compiled/@vercel/og/index.edge.js +2587 -3024
  14. package/dist/compiled/@vercel/og/index.node.d.ts +7 -10
  15. package/dist/compiled/@vercel/og/index.node.js +2585 -3022
  16. package/dist/compiled/@vercel/og/language/index.d.ts +28 -0
  17. package/dist/compiled/@vercel/og/og.d.ts +1 -0
  18. package/dist/compiled/@vercel/og/package.json +1 -1
  19. package/dist/compiled/@vercel/og/satori/index.d.ts +4 -1
  20. package/dist/compiled/@vercel/og/types.d.ts +118 -0
  21. package/dist/compiled/@vercel/og/yoga.wasm +0 -0
  22. package/dist/esm/build/index.js +2 -2
  23. package/dist/esm/build/swc/generated-native.d.ts +0 -33
  24. package/dist/esm/build/swc/index.js +1 -11
  25. package/dist/esm/build/swc/index.js.map +1 -1
  26. package/dist/esm/build/swc/types.js.map +1 -1
  27. package/dist/esm/build/webpack-config.js +2 -2
  28. package/dist/esm/client/app-bootstrap.js +1 -1
  29. package/dist/esm/client/index.js +1 -1
  30. package/dist/esm/server/dev/hot-reloader-turbopack.js +1 -1
  31. package/dist/esm/server/dev/hot-reloader-webpack.js +1 -1
  32. package/dist/esm/server/lib/app-info-log.js +1 -1
  33. package/dist/esm/server/lib/router-utils/setup-dev-bundler.js +3 -84
  34. package/dist/esm/server/lib/router-utils/setup-dev-bundler.js.map +1 -1
  35. package/dist/esm/server/lib/start-server.js +1 -1
  36. package/dist/esm/shared/lib/canary-only.js +1 -1
  37. package/dist/esm/shared/lib/turbopack/utils.js +28 -32
  38. package/dist/esm/shared/lib/turbopack/utils.js.map +1 -1
  39. package/dist/server/dev/hot-reloader-turbopack.js +1 -1
  40. package/dist/server/dev/hot-reloader-webpack.js +1 -1
  41. package/dist/server/lib/app-info-log.js +1 -1
  42. package/dist/server/lib/router-utils/setup-dev-bundler.js +3 -84
  43. package/dist/server/lib/router-utils/setup-dev-bundler.js.map +1 -1
  44. package/dist/server/lib/start-server.js +1 -1
  45. package/dist/shared/lib/canary-only.js +1 -1
  46. package/dist/shared/lib/turbopack/utils.d.ts +1 -2
  47. package/dist/shared/lib/turbopack/utils.js +28 -36
  48. package/dist/shared/lib/turbopack/utils.js.map +1 -1
  49. package/dist/telemetry/anonymous-meta.js +1 -1
  50. package/dist/telemetry/events/session-stopped.js +2 -2
  51. package/dist/telemetry/events/version.js +2 -2
  52. package/package.json +15 -20
  53. package/server.d.ts +1 -1
  54. package/dist/compiled/@vercel/og/types-d38469ff.d.ts +0 -74
  55. package/dist/esm/server/lib/router-utils/mcp.js +0 -471
  56. package/dist/esm/server/lib/router-utils/mcp.js.map +0 -1
  57. package/dist/server/lib/router-utils/mcp.d.ts +0 -4
  58. package/dist/server/lib/router-utils/mcp.js +0 -534
  59. package/dist/server/lib/router-utils/mcp.js.map +0 -1
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  0 && (module.exports = {
6
6
  ModuleBuildError: null,
7
- formatImportTraces: null,
8
7
  formatIssue: null,
9
8
  getIssueKey: null,
10
9
  getTurbopackJsConfig: null,
@@ -24,9 +23,6 @@ _export(exports, {
24
23
  ModuleBuildError: function() {
25
24
  return ModuleBuildError;
26
25
  },
27
- formatImportTraces: function() {
28
- return formatImportTraces;
29
- },
30
26
  formatIssue: function() {
31
27
  return formatIssue;
32
28
  },
@@ -164,41 +160,37 @@ function formatIssue(issue) {
164
160
  // }
165
161
  if (importTraces == null ? void 0 : importTraces.length) {
166
162
  // This is the same logic as in turbopack/crates/turbopack-cli-utils/src/issue.rs
167
- message += formatImportTraces(importTraces);
168
- }
169
- if (documentationLink) {
170
- message += documentationLink + '\n\n';
171
- }
172
- return message;
173
- }
174
- function formatImportTraces(importTraces) {
175
- // We end up with multiple traces when the file with the error is reachable from multiple
176
- // different entry points (e.g. ssr, client)
177
- let message = "Import trace" + (importTraces.length > 1 ? 's' : '') + ":\n";
178
- const everyTraceHasADistinctRootLayer = new Set(importTraces.map(leafLayerName).filter((l)=>l != null)).size === importTraces.length;
179
- for(let i = 0; i < importTraces.length; i++){
180
- const trace = importTraces[i];
181
- const layer = leafLayerName(trace);
182
- let traceIndent = ' ';
183
- // If this is true, layer must be present
184
- if (everyTraceHasADistinctRootLayer) {
185
- message += " " + layer + ":\n";
186
- } else {
187
- if (importTraces.length > 1) {
188
- // Otherwise use simple 1 based indices to disambiguate
189
- message += " #" + (i + 1);
190
- if (layer) {
191
- message += " [" + layer + "]";
192
- }
193
- message += ':\n';
194
- } else if (layer) {
195
- message += " [" + layer + "]:\n";
163
+ // We end up with multiple traces when the file with the error is reachable from multiple
164
+ // different entry points (e.g. ssr, client)
165
+ message += "Import trace" + (importTraces.length > 1 ? 's' : '') + ":\n";
166
+ const everyTraceHasADistinctRootLayer = new Set(importTraces.map(leafLayerName).filter((l)=>l != null)).size === importTraces.length;
167
+ for(let i = 0; i < importTraces.length; i++){
168
+ const trace = importTraces[i];
169
+ const layer = leafLayerName(trace);
170
+ let traceIndent = ' ';
171
+ // If this is true, layer must be present
172
+ if (everyTraceHasADistinctRootLayer) {
173
+ message += " " + layer + ":\n";
196
174
  } else {
197
- // If there is a single trace and no layer name just don't indent it.
198
- traceIndent = ' ';
175
+ if (importTraces.length > 1) {
176
+ // Otherwise use simple 1 based indices to disambiguate
177
+ message += " #" + (i + 1);
178
+ if (layer) {
179
+ message += " [" + layer + "]";
180
+ }
181
+ message += ':\n';
182
+ } else if (layer) {
183
+ message += " [" + layer + "]:\n";
184
+ } else {
185
+ // If there is a single trace and no layer name just don't indent it.
186
+ traceIndent = ' ';
187
+ }
199
188
  }
189
+ message += formatIssueTrace(trace, traceIndent, !identicalLayers(trace));
200
190
  }
201
- message += formatIssueTrace(trace, traceIndent, !identicalLayers(trace));
191
+ }
192
+ if (documentationLink) {
193
+ message += documentationLink + '\n\n';
202
194
  }
203
195
  return message;
204
196
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/shared/lib/turbopack/utils.ts"],"sourcesContent":["import type {\n Issue,\n PlainTraceItem,\n StyledString,\n TurbopackResult,\n} from '../../../build/swc/types'\n\nimport { bold, green, magenta, red } from '../../../lib/picocolors'\nimport isInternal from '../is-internal'\nimport {\n decodeMagicIdentifier,\n MAGIC_IDENTIFIER_REGEX,\n} from '../magic-identifier'\nimport type { EntryKey } from './entry-key'\nimport * as Log from '../../../build/output/log'\nimport type { NextConfigComplete } from '../../../server/config-shared'\nimport loadJsConfig from '../../../build/load-jsconfig'\n\ntype IssueKey = `${Issue['severity']}-${Issue['filePath']}-${string}-${string}`\nexport type IssuesMap = Map<IssueKey, Issue>\nexport type EntryIssuesMap = Map<EntryKey, IssuesMap>\nexport type TopLevelIssuesMap = IssuesMap\n\n/**\n * An error generated from emitted Turbopack issues. This can include build\n * errors caused by issues with user code.\n */\nexport class ModuleBuildError extends Error {\n name = 'ModuleBuildError'\n}\n\n/**\n * Thin stopgap workaround layer to mimic existing wellknown-errors-plugin in webpack's build\n * to emit certain type of errors into cli.\n */\nexport function isWellKnownError(issue: Issue): boolean {\n const { title } = issue\n const formattedTitle = renderStyledStringToErrorAnsi(title)\n // TODO: add more well known errors\n if (\n formattedTitle.includes('Module not found') ||\n formattedTitle.includes('Unknown module type')\n ) {\n return true\n }\n\n return false\n}\n\nexport function getIssueKey(issue: Issue): IssueKey {\n return `${issue.severity}-${issue.filePath}-${JSON.stringify(\n issue.title\n )}-${JSON.stringify(issue.description)}`\n}\n\nexport async function getTurbopackJsConfig(\n dir: string,\n nextConfig: NextConfigComplete\n) {\n const { jsConfig } = await loadJsConfig(dir, nextConfig)\n return jsConfig ?? { compilerOptions: {} }\n}\n\nexport function processIssues(\n currentEntryIssues: EntryIssuesMap,\n key: EntryKey,\n result: TurbopackResult,\n throwIssue: boolean,\n logErrors: boolean\n) {\n const newIssues = new Map<IssueKey, Issue>()\n currentEntryIssues.set(key, newIssues)\n\n const relevantIssues = new Set()\n\n for (const issue of result.issues) {\n if (\n issue.severity !== 'error' &&\n issue.severity !== 'fatal' &&\n issue.severity !== 'warning'\n )\n continue\n\n const issueKey = getIssueKey(issue)\n newIssues.set(issueKey, issue)\n\n if (issue.severity !== 'warning') {\n if (throwIssue) {\n const formatted = formatIssue(issue)\n relevantIssues.add(formatted)\n }\n // if we throw the issue it will most likely get handed and logged elsewhere\n else if (logErrors && isWellKnownError(issue)) {\n const formatted = formatIssue(issue)\n Log.error(formatted)\n }\n }\n }\n\n if (relevantIssues.size && throwIssue) {\n throw new ModuleBuildError([...relevantIssues].join('\\n\\n'))\n }\n}\n\nexport function formatIssue(issue: Issue) {\n const { filePath, title, description, source, importTraces } = issue\n let { documentationLink } = issue\n const formattedTitle = renderStyledStringToErrorAnsi(title).replace(\n /\\n/g,\n '\\n '\n )\n\n // TODO: Use error codes to identify these\n // TODO: Generalize adapting Turbopack errors to Next.js errors\n if (formattedTitle.includes('Module not found')) {\n // For compatiblity with webpack\n // TODO: include columns in webpack errors.\n documentationLink = 'https://nextjs.org/docs/messages/module-not-found'\n }\n\n const formattedFilePath = filePath\n .replace('[project]/', './')\n .replaceAll('/./', '/')\n .replace('\\\\\\\\?\\\\', '')\n\n let message = ''\n\n if (source?.range) {\n const { start } = source.range\n message = `${formattedFilePath}:${start.line + 1}:${\n start.column + 1\n }\\n${formattedTitle}`\n } else if (formattedFilePath) {\n message = `${formattedFilePath}\\n${formattedTitle}`\n } else {\n message = formattedTitle\n }\n message += '\\n'\n\n if (\n source?.range &&\n source.source.content &&\n // ignore Next.js/React internals, as these can often be huge bundled files.\n !isInternal(filePath)\n ) {\n const { start, end } = source.range\n const { codeFrameColumns } =\n require('next/dist/compiled/babel/code-frame') as typeof import('next/dist/compiled/babel/code-frame')\n\n message +=\n codeFrameColumns(\n source.source.content,\n {\n start: {\n line: start.line + 1,\n column: start.column + 1,\n },\n end: {\n line: end.line + 1,\n column: end.column + 1,\n },\n },\n { forceColor: true }\n ).trim() + '\\n\\n'\n }\n\n if (description) {\n if (\n description.type === 'text' &&\n description.value.includes(`Cannot find module 'sass'`)\n ) {\n message +=\n \"To use Next.js' built-in Sass support, you first need to install `sass`.\\n\"\n message += 'Run `npm i sass` or `yarn add sass` inside your workspace.\\n'\n message += '\\nLearn more: https://nextjs.org/docs/messages/install-sass'\n } else {\n message += renderStyledStringToErrorAnsi(description) + '\\n\\n'\n }\n }\n\n // TODO: make it possible to enable this for debugging, but not in tests.\n // if (detail) {\n // message += renderStyledStringToErrorAnsi(detail) + '\\n\\n'\n // }\n\n if (importTraces?.length) {\n // This is the same logic as in turbopack/crates/turbopack-cli-utils/src/issue.rs\n message += formatImportTraces(importTraces)\n }\n if (documentationLink) {\n message += documentationLink + '\\n\\n'\n }\n return message\n}\n\nexport function formatImportTraces(importTraces: PlainTraceItem[][]) {\n // We end up with multiple traces when the file with the error is reachable from multiple\n // different entry points (e.g. ssr, client)\n let message = `Import trace${importTraces.length > 1 ? 's' : ''}:\\n`\n const everyTraceHasADistinctRootLayer =\n new Set(importTraces.map(leafLayerName).filter((l) => l != null)).size ===\n importTraces.length\n for (let i = 0; i < importTraces.length; i++) {\n const trace = importTraces[i]\n const layer = leafLayerName(trace)\n let traceIndent = ' '\n // If this is true, layer must be present\n if (everyTraceHasADistinctRootLayer) {\n message += ` ${layer}:\\n`\n } else {\n if (importTraces.length > 1) {\n // Otherwise use simple 1 based indices to disambiguate\n message += ` #${i + 1}`\n if (layer) {\n message += ` [${layer}]`\n }\n message += ':\\n'\n } else if (layer) {\n message += ` [${layer}]:\\n`\n } else {\n // If there is a single trace and no layer name just don't indent it.\n traceIndent = ' '\n }\n }\n message += formatIssueTrace(trace, traceIndent, !identicalLayers(trace))\n }\n return message\n}\n\n/** Returns the first present layer name in the trace */\nfunction leafLayerName(items: PlainTraceItem[]): string | undefined {\n for (const item of items) {\n const layer = item.layer\n if (layer != null) return layer\n }\n return undefined\n}\n\n/**\n * Returns whether or not all items share the same layer.\n * If a layer is absent we ignore it in this analysis\n */\nfunction identicalLayers(items: PlainTraceItem[]): boolean {\n const firstPresentLayer = items.findIndex((t) => t.layer != null)\n if (firstPresentLayer === -1) return true // all layers are absent\n const layer = items[firstPresentLayer].layer\n for (let i = firstPresentLayer + 1; i < items.length; i++) {\n const itemLayer = items[i].layer\n if (itemLayer == null || itemLayer !== layer) {\n return false\n }\n }\n return true\n}\n\nfunction formatIssueTrace(\n items: PlainTraceItem[],\n indent: string,\n printLayers: boolean\n): string {\n return `${items\n .map((item) => {\n let r = indent\n if (item.fsName !== 'project') {\n r += `[${item.fsName}]/`\n } else {\n // This is consistent with webpack's output\n r += './'\n }\n r += item.path\n if (printLayers && item.layer) {\n r += ` [${item.layer}]`\n }\n return r\n })\n .join('\\n')}\\n\\n`\n}\n\nexport function isRelevantWarning(issue: Issue): boolean {\n return issue.severity === 'warning' && !isNodeModulesIssue(issue)\n}\n\nfunction isNodeModulesIssue(issue: Issue): boolean {\n if (issue.severity === 'warning' && issue.stage === 'config') {\n // Override for the externalize issue\n // `Package foo (serverExternalPackages or default list) can't be external`\n if (\n renderStyledStringToErrorAnsi(issue.title).includes(\"can't be external\")\n ) {\n return false\n }\n }\n\n return (\n issue.severity === 'warning' &&\n (issue.filePath.match(/^(?:.*[\\\\/])?node_modules(?:[\\\\/].*)?$/) !== null ||\n // Ignore Next.js itself when running next directly in the monorepo where it is not inside\n // node_modules anyway.\n // TODO(mischnic) prevent matches when this is published to npm\n issue.filePath.startsWith('[project]/packages/next/'))\n )\n}\n\nexport function renderStyledStringToErrorAnsi(string: StyledString): string {\n function decodeMagicIdentifiers(str: string): string {\n return str.replaceAll(MAGIC_IDENTIFIER_REGEX, (ident) => {\n try {\n return magenta(`{${decodeMagicIdentifier(ident)}}`)\n } catch (e) {\n return magenta(`{${ident} (decoding failed: ${e})}`)\n }\n })\n }\n\n switch (string.type) {\n case 'text':\n return decodeMagicIdentifiers(string.value)\n case 'strong':\n return bold(red(decodeMagicIdentifiers(string.value)))\n case 'code':\n return green(decodeMagicIdentifiers(string.value))\n case 'line':\n return string.value.map(renderStyledStringToErrorAnsi).join('')\n case 'stack':\n return string.value.map(renderStyledStringToErrorAnsi).join('\\n')\n default:\n throw new Error('Unknown StyledString type', string)\n }\n}\n\nexport function isPersistentCachingEnabled(\n config: NextConfigComplete\n): boolean {\n return config.experimental?.turbopackPersistentCaching || false\n}\n"],"names":["ModuleBuildError","formatImportTraces","formatIssue","getIssueKey","getTurbopackJsConfig","isPersistentCachingEnabled","isRelevantWarning","isWellKnownError","processIssues","renderStyledStringToErrorAnsi","Error","name","issue","title","formattedTitle","includes","severity","filePath","JSON","stringify","description","dir","nextConfig","jsConfig","loadJsConfig","compilerOptions","currentEntryIssues","key","result","throwIssue","logErrors","newIssues","Map","set","relevantIssues","Set","issues","issueKey","formatted","add","Log","error","size","join","source","importTraces","documentationLink","replace","formattedFilePath","replaceAll","message","range","start","line","column","content","isInternal","end","codeFrameColumns","require","forceColor","trim","type","value","length","everyTraceHasADistinctRootLayer","map","leafLayerName","filter","l","i","trace","layer","traceIndent","formatIssueTrace","identicalLayers","items","item","undefined","firstPresentLayer","findIndex","t","itemLayer","indent","printLayers","r","fsName","path","isNodeModulesIssue","stage","match","startsWith","string","decodeMagicIdentifiers","str","MAGIC_IDENTIFIER_REGEX","ident","magenta","decodeMagicIdentifier","e","bold","red","green","config","experimental","turbopackPersistentCaching"],"mappings":";;;;;;;;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O,EAAC,AAAC,MAAGD,QAAM,wBAAqBG,IAAE;YAClD;QACF;IACF;IAEA,OAAQP,OAAO9B,IAAI;QACjB,KAAK;YACH,OAAO+B,uBAAuBD,OAAO7B,KAAK;QAC5C,KAAK;YACH,OAAOqC,IAAAA,gBAAI,EAACC,IAAAA,eAAG,EAACR,uBAAuBD,OAAO7B,KAAK;QACrD,KAAK;YACH,OAAOuC,IAAAA,iBAAK,EAACT,uBAAuBD,OAAO7B,KAAK;QAClD,KAAK;YACH,OAAO6B,OAAO7B,KAAK,CAACG,GAAG,CAACzD,+BAA+BkC,IAAI,CAAC;QAC9D,KAAK;YACH,OAAOiD,OAAO7B,KAAK,CAACG,GAAG,CAACzD,+BAA+BkC,IAAI,CAAC;QAC9D;YACE,MAAM,qBAA8C,CAA9C,IAAIjC,MAAM,6BAA6BkF,SAAvC,qBAAA;uBAAA;4BAAA;8BAAA;YAA6C;IACvD;AACF;AAEO,SAASvF,2BACdkG,MAA0B;QAEnBA;IAAP,OAAOA,EAAAA,uBAAAA,OAAOC,YAAY,qBAAnBD,qBAAqBE,0BAA0B,KAAI;AAC5D","ignoreList":[0]}
1
+ {"version":3,"sources":["../../../../src/shared/lib/turbopack/utils.ts"],"sourcesContent":["import type {\n Issue,\n PlainTraceItem,\n StyledString,\n TurbopackResult,\n} from '../../../build/swc/types'\n\nimport { bold, green, magenta, red } from '../../../lib/picocolors'\nimport isInternal from '../is-internal'\nimport {\n decodeMagicIdentifier,\n MAGIC_IDENTIFIER_REGEX,\n} from '../magic-identifier'\nimport type { EntryKey } from './entry-key'\nimport * as Log from '../../../build/output/log'\nimport type { NextConfigComplete } from '../../../server/config-shared'\nimport loadJsConfig from '../../../build/load-jsconfig'\n\ntype IssueKey = `${Issue['severity']}-${Issue['filePath']}-${string}-${string}`\nexport type IssuesMap = Map<IssueKey, Issue>\nexport type EntryIssuesMap = Map<EntryKey, IssuesMap>\nexport type TopLevelIssuesMap = IssuesMap\n\n/**\n * An error generated from emitted Turbopack issues. This can include build\n * errors caused by issues with user code.\n */\nexport class ModuleBuildError extends Error {\n name = 'ModuleBuildError'\n}\n\n/**\n * Thin stopgap workaround layer to mimic existing wellknown-errors-plugin in webpack's build\n * to emit certain type of errors into cli.\n */\nexport function isWellKnownError(issue: Issue): boolean {\n const { title } = issue\n const formattedTitle = renderStyledStringToErrorAnsi(title)\n // TODO: add more well known errors\n if (\n formattedTitle.includes('Module not found') ||\n formattedTitle.includes('Unknown module type')\n ) {\n return true\n }\n\n return false\n}\n\nexport function getIssueKey(issue: Issue): IssueKey {\n return `${issue.severity}-${issue.filePath}-${JSON.stringify(\n issue.title\n )}-${JSON.stringify(issue.description)}`\n}\n\nexport async function getTurbopackJsConfig(\n dir: string,\n nextConfig: NextConfigComplete\n) {\n const { jsConfig } = await loadJsConfig(dir, nextConfig)\n return jsConfig ?? { compilerOptions: {} }\n}\n\nexport function processIssues(\n currentEntryIssues: EntryIssuesMap,\n key: EntryKey,\n result: TurbopackResult,\n throwIssue: boolean,\n logErrors: boolean\n) {\n const newIssues = new Map<IssueKey, Issue>()\n currentEntryIssues.set(key, newIssues)\n\n const relevantIssues = new Set()\n\n for (const issue of result.issues) {\n if (\n issue.severity !== 'error' &&\n issue.severity !== 'fatal' &&\n issue.severity !== 'warning'\n )\n continue\n\n const issueKey = getIssueKey(issue)\n newIssues.set(issueKey, issue)\n\n if (issue.severity !== 'warning') {\n if (throwIssue) {\n const formatted = formatIssue(issue)\n relevantIssues.add(formatted)\n }\n // if we throw the issue it will most likely get handed and logged elsewhere\n else if (logErrors && isWellKnownError(issue)) {\n const formatted = formatIssue(issue)\n Log.error(formatted)\n }\n }\n }\n\n if (relevantIssues.size && throwIssue) {\n throw new ModuleBuildError([...relevantIssues].join('\\n\\n'))\n }\n}\n\nexport function formatIssue(issue: Issue) {\n const { filePath, title, description, source, importTraces } = issue\n let { documentationLink } = issue\n const formattedTitle = renderStyledStringToErrorAnsi(title).replace(\n /\\n/g,\n '\\n '\n )\n\n // TODO: Use error codes to identify these\n // TODO: Generalize adapting Turbopack errors to Next.js errors\n if (formattedTitle.includes('Module not found')) {\n // For compatiblity with webpack\n // TODO: include columns in webpack errors.\n documentationLink = 'https://nextjs.org/docs/messages/module-not-found'\n }\n\n const formattedFilePath = filePath\n .replace('[project]/', './')\n .replaceAll('/./', '/')\n .replace('\\\\\\\\?\\\\', '')\n\n let message = ''\n\n if (source?.range) {\n const { start } = source.range\n message = `${formattedFilePath}:${start.line + 1}:${\n start.column + 1\n }\\n${formattedTitle}`\n } else if (formattedFilePath) {\n message = `${formattedFilePath}\\n${formattedTitle}`\n } else {\n message = formattedTitle\n }\n message += '\\n'\n\n if (\n source?.range &&\n source.source.content &&\n // ignore Next.js/React internals, as these can often be huge bundled files.\n !isInternal(filePath)\n ) {\n const { start, end } = source.range\n const { codeFrameColumns } =\n require('next/dist/compiled/babel/code-frame') as typeof import('next/dist/compiled/babel/code-frame')\n\n message +=\n codeFrameColumns(\n source.source.content,\n {\n start: {\n line: start.line + 1,\n column: start.column + 1,\n },\n end: {\n line: end.line + 1,\n column: end.column + 1,\n },\n },\n { forceColor: true }\n ).trim() + '\\n\\n'\n }\n\n if (description) {\n if (\n description.type === 'text' &&\n description.value.includes(`Cannot find module 'sass'`)\n ) {\n message +=\n \"To use Next.js' built-in Sass support, you first need to install `sass`.\\n\"\n message += 'Run `npm i sass` or `yarn add sass` inside your workspace.\\n'\n message += '\\nLearn more: https://nextjs.org/docs/messages/install-sass'\n } else {\n message += renderStyledStringToErrorAnsi(description) + '\\n\\n'\n }\n }\n\n // TODO: make it possible to enable this for debugging, but not in tests.\n // if (detail) {\n // message += renderStyledStringToErrorAnsi(detail) + '\\n\\n'\n // }\n\n if (importTraces?.length) {\n // This is the same logic as in turbopack/crates/turbopack-cli-utils/src/issue.rs\n // We end up with multiple traces when the file with the error is reachable from multiple\n // different entry points (e.g. ssr, client)\n message += `Import trace${importTraces.length > 1 ? 's' : ''}:\\n`\n const everyTraceHasADistinctRootLayer =\n new Set(importTraces.map(leafLayerName).filter((l) => l != null)).size ===\n importTraces.length\n for (let i = 0; i < importTraces.length; i++) {\n const trace = importTraces[i]\n const layer = leafLayerName(trace)\n let traceIndent = ' '\n // If this is true, layer must be present\n if (everyTraceHasADistinctRootLayer) {\n message += ` ${layer}:\\n`\n } else {\n if (importTraces.length > 1) {\n // Otherwise use simple 1 based indices to disambiguate\n message += ` #${i + 1}`\n if (layer) {\n message += ` [${layer}]`\n }\n message += ':\\n'\n } else if (layer) {\n message += ` [${layer}]:\\n`\n } else {\n // If there is a single trace and no layer name just don't indent it.\n traceIndent = ' '\n }\n }\n message += formatIssueTrace(trace, traceIndent, !identicalLayers(trace))\n }\n }\n if (documentationLink) {\n message += documentationLink + '\\n\\n'\n }\n return message\n}\n\n/** Returns the first present layer name in the trace */\nfunction leafLayerName(items: PlainTraceItem[]): string | undefined {\n for (const item of items) {\n const layer = item.layer\n if (layer != null) return layer\n }\n return undefined\n}\n\n/**\n * Returns whether or not all items share the same layer.\n * If a layer is absent we ignore it in this analysis\n */\nfunction identicalLayers(items: PlainTraceItem[]): boolean {\n const firstPresentLayer = items.findIndex((t) => t.layer != null)\n if (firstPresentLayer === -1) return true // all layers are absent\n const layer = items[firstPresentLayer].layer\n for (let i = firstPresentLayer + 1; i < items.length; i++) {\n const itemLayer = items[i].layer\n if (itemLayer == null || itemLayer !== layer) {\n return false\n }\n }\n return true\n}\n\nfunction formatIssueTrace(\n items: PlainTraceItem[],\n indent: string,\n printLayers: boolean\n): string {\n return `${items\n .map((item) => {\n let r = indent\n if (item.fsName !== 'project') {\n r += `[${item.fsName}]/`\n } else {\n // This is consistent with webpack's output\n r += './'\n }\n r += item.path\n if (printLayers && item.layer) {\n r += ` [${item.layer}]`\n }\n return r\n })\n .join('\\n')}\\n\\n`\n}\n\nexport function isRelevantWarning(issue: Issue): boolean {\n return issue.severity === 'warning' && !isNodeModulesIssue(issue)\n}\n\nfunction isNodeModulesIssue(issue: Issue): boolean {\n if (issue.severity === 'warning' && issue.stage === 'config') {\n // Override for the externalize issue\n // `Package foo (serverExternalPackages or default list) can't be external`\n if (\n renderStyledStringToErrorAnsi(issue.title).includes(\"can't be external\")\n ) {\n return false\n }\n }\n\n return (\n issue.severity === 'warning' &&\n (issue.filePath.match(/^(?:.*[\\\\/])?node_modules(?:[\\\\/].*)?$/) !== null ||\n // Ignore Next.js itself when running next directly in the monorepo where it is not inside\n // node_modules anyway.\n // TODO(mischnic) prevent matches when this is published to npm\n issue.filePath.startsWith('[project]/packages/next/'))\n )\n}\n\nexport function renderStyledStringToErrorAnsi(string: StyledString): string {\n function decodeMagicIdentifiers(str: string): string {\n return str.replaceAll(MAGIC_IDENTIFIER_REGEX, (ident) => {\n try {\n return magenta(`{${decodeMagicIdentifier(ident)}}`)\n } catch (e) {\n return magenta(`{${ident} (decoding failed: ${e})}`)\n }\n })\n }\n\n switch (string.type) {\n case 'text':\n return decodeMagicIdentifiers(string.value)\n case 'strong':\n return bold(red(decodeMagicIdentifiers(string.value)))\n case 'code':\n return green(decodeMagicIdentifiers(string.value))\n case 'line':\n return string.value.map(renderStyledStringToErrorAnsi).join('')\n case 'stack':\n return string.value.map(renderStyledStringToErrorAnsi).join('\\n')\n default:\n throw new Error('Unknown StyledString type', string)\n }\n}\n\nexport function isPersistentCachingEnabled(\n config: NextConfigComplete\n): boolean {\n return config.experimental?.turbopackPersistentCaching || false\n}\n"],"names":["ModuleBuildError","formatIssue","getIssueKey","getTurbopackJsConfig","isPersistentCachingEnabled","isRelevantWarning","isWellKnownError","processIssues","renderStyledStringToErrorAnsi","Error","name","issue","title","formattedTitle","includes","severity","filePath","JSON","stringify","description","dir","nextConfig","jsConfig","loadJsConfig","compilerOptions","currentEntryIssues","key","result","throwIssue","logErrors","newIssues","Map","set","relevantIssues","Set","issues","issueKey","formatted","add","Log","error","size","join","source","importTraces","documentationLink","replace","formattedFilePath","replaceAll","message","range","start","line","column","content","isInternal","end","codeFrameColumns","require","forceColor","trim","type","value","length","everyTraceHasADistinctRootLayer","map","leafLayerName","filter","l","i","trace","layer","traceIndent","formatIssueTrace","identicalLayers","items","item","undefined","firstPresentLayer","findIndex","t","itemLayer","indent","printLayers","r","fsName","path","isNodeModulesIssue","stage","match","startsWith","string","decodeMagicIdentifiers","str","MAGIC_IDENTIFIER_REGEX","ident","magenta","decodeMagicIdentifier","e","bold","red","green","config","experimental","turbopackPersistentCaching"],"mappings":";;;;;;;;;;;;;;;;;;;;;;IA2BaA,gBAAgB;eAAhBA;;IA6EGC,WAAW;eAAXA;;IAvDAC,WAAW;eAAXA;;IAMMC,oBAAoB;eAApBA;;IA8QNC,0BAA0B;eAA1BA;;IApDAC,iBAAiB;eAAjBA;;IA9OAC,gBAAgB;eAAhBA;;IA4BAC,aAAa;eAAbA;;IA2OAC,6BAA6B;eAA7BA;;;;;4BAnS0B;qEACnB;iCAIhB;+DAEc;uEAEI;AAWlB,MAAMR,yBAAyBS;;QAA/B,qBACLC,OAAO;;AACT;AAMO,SAASJ,iBAAiBK,KAAY;IAC3C,MAAM,EAAEC,KAAK,EAAE,GAAGD;IAClB,MAAME,iBAAiBL,8BAA8BI;IACrD,mCAAmC;IACnC,IACEC,eAAeC,QAAQ,CAAC,uBACxBD,eAAeC,QAAQ,CAAC,wBACxB;QACA,OAAO;IACT;IAEA,OAAO;AACT;AAEO,SAASZ,YAAYS,KAAY;IACtC,OAAO,AAAGA,MAAMI,QAAQ,GAAC,MAAGJ,MAAMK,QAAQ,GAAC,MAAGC,KAAKC,SAAS,CAC1DP,MAAMC,KAAK,IACX,MAAGK,KAAKC,SAAS,CAACP,MAAMQ,WAAW;AACvC;AAEO,eAAehB,qBACpBiB,GAAW,EACXC,UAA8B;IAE9B,MAAM,EAAEC,QAAQ,EAAE,GAAG,MAAMC,IAAAA,qBAAY,EAACH,KAAKC;IAC7C,OAAOC,mBAAAA,WAAY;QAAEE,iBAAiB,CAAC;IAAE;AAC3C;AAEO,SAASjB,cACdkB,kBAAkC,EAClCC,GAAa,EACbC,MAAuB,E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sB,EAAE,CAACC;YAC7C,IAAI;gBACF,OAAOC,IAAAA,mBAAO,EAAC,AAAC,MAAGC,IAAAA,sCAAqB,EAACF,SAAO;YAClD,EAAE,OAAOG,GAAG;gBACV,OAAOF,IAAAA,mBAAO,EAAC,AAAC,MAAGD,QAAM,wBAAqBG,IAAE;YAClD;QACF;IACF;IAEA,OAAQP,OAAO9B,IAAI;QACjB,KAAK;YACH,OAAO+B,uBAAuBD,OAAO7B,KAAK;QAC5C,KAAK;YACH,OAAOqC,IAAAA,gBAAI,EAACC,IAAAA,eAAG,EAACR,uBAAuBD,OAAO7B,KAAK;QACrD,KAAK;YACH,OAAOuC,IAAAA,iBAAK,EAACT,uBAAuBD,OAAO7B,KAAK;QAClD,KAAK;YACH,OAAO6B,OAAO7B,KAAK,CAACG,GAAG,CAACzD,+BAA+BkC,IAAI,CAAC;QAC9D,KAAK;YACH,OAAOiD,OAAO7B,KAAK,CAACG,GAAG,CAACzD,+BAA+BkC,IAAI,CAAC;QAC9D;YACE,MAAM,qBAA8C,CAA9C,IAAIjC,MAAM,6BAA6BkF,SAAvC,qBAAA;uBAAA;4BAAA;8BAAA;YAA6C;IACvD;AACF;AAEO,SAASvF,2BACdkG,MAA0B;QAEnBA;IAAP,OAAOA,EAAAA,uBAAAA,OAAOC,YAAY,qBAAnBD,qBAAqBE,0BAA0B,KAAI;AAC5D","ignoreList":[0]}
@@ -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: "15.4.2-canary.22"
84
+ nextVersion: "15.4.2-canary.23"
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 "15.4.2-canary.22" !== 'string') {
14
+ if (typeof "15.4.2-canary.23" !== 'string') {
15
15
  return [];
16
16
  }
17
17
  const payload = {
18
- nextVersion: "15.4.2-canary.22",
18
+ nextVersion: "15.4.2-canary.23",
19
19
  nodeVersion: process.version,
20
20
  cliCommand: event.cliCommand,
21
21
  durationMilliseconds: event.durationMilliseconds,
@@ -36,12 +36,12 @@ function hasBabelConfig(dir) {
36
36
  function eventCliSession(dir, nextConfig, event) {
37
37
  var _nextConfig_experimental_staleTimes, _nextConfig_experimental_staleTimes1, _nextConfig_experimental_reactCompiler, _nextConfig_experimental_reactCompiler1;
38
38
  // This should be an invariant, if it fails our build tooling is broken.
39
- if (typeof "15.4.2-canary.22" !== 'string') {
39
+ if (typeof "15.4.2-canary.23" !== 'string') {
40
40
  return [];
41
41
  }
42
42
  const { images, i18n } = nextConfig || {};
43
43
  const payload = {
44
- nextVersion: "15.4.2-canary.22",
44
+ nextVersion: "15.4.2-canary.23",
45
45
  nodeVersion: process.version,
46
46
  cliCommand: event.cliCommand,
47
47
  isSrcDir: event.isSrcDir,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next",
3
- "version": "15.4.2-canary.22",
3
+ "version": "15.4.2-canary.23",
4
4
  "description": "The React Framework",
5
5
  "main": "./dist/server/next.js",
6
6
  "license": "MIT",
@@ -102,14 +102,13 @@
102
102
  ]
103
103
  },
104
104
  "dependencies": {
105
- "@next/env": "15.4.2-canary.22",
105
+ "@next/env": "15.4.2-canary.23",
106
106
  "@swc/helpers": "0.5.15",
107
107
  "caniuse-lite": "^1.0.30001579",
108
108
  "postcss": "8.4.31",
109
109
  "styled-jsx": "5.1.6"
110
110
  },
111
111
  "peerDependencies": {
112
- "@modelcontextprotocol/sdk": "^1.15.1",
113
112
  "@opentelemetry/api": "^1.1.0",
114
113
  "@playwright/test": "^1.51.1",
115
114
  "babel-plugin-react-compiler": "*",
@@ -124,9 +123,6 @@
124
123
  "sass": {
125
124
  "optional": true
126
125
  },
127
- "@modelcontextprotocol/sdk": {
128
- "optional": true
129
- },
130
126
  "@opentelemetry/api": {
131
127
  "optional": true
132
128
  },
@@ -136,14 +132,14 @@
136
132
  },
137
133
  "optionalDependencies": {
138
134
  "sharp": "^0.34.3",
139
- "@next/swc-darwin-arm64": "15.4.2-canary.22",
140
- "@next/swc-darwin-x64": "15.4.2-canary.22",
141
- "@next/swc-linux-arm64-gnu": "15.4.2-canary.22",
142
- "@next/swc-linux-arm64-musl": "15.4.2-canary.22",
143
- "@next/swc-linux-x64-gnu": "15.4.2-canary.22",
144
- "@next/swc-linux-x64-musl": "15.4.2-canary.22",
145
- "@next/swc-win32-arm64-msvc": "15.4.2-canary.22",
146
- "@next/swc-win32-x64-msvc": "15.4.2-canary.22"
135
+ "@next/swc-darwin-arm64": "15.4.2-canary.23",
136
+ "@next/swc-darwin-x64": "15.4.2-canary.23",
137
+ "@next/swc-linux-arm64-gnu": "15.4.2-canary.23",
138
+ "@next/swc-linux-arm64-musl": "15.4.2-canary.23",
139
+ "@next/swc-linux-x64-gnu": "15.4.2-canary.23",
140
+ "@next/swc-linux-x64-musl": "15.4.2-canary.23",
141
+ "@next/swc-win32-arm64-msvc": "15.4.2-canary.23",
142
+ "@next/swc-win32-x64-msvc": "15.4.2-canary.23"
147
143
  },
148
144
  "devDependencies": {
149
145
  "@ampproject/toolbox-optimizer": "2.8.3",
@@ -176,14 +172,13 @@
176
172
  "@hapi/accept": "5.0.2",
177
173
  "@jest/transform": "29.5.0",
178
174
  "@jest/types": "29.5.0",
179
- "@modelcontextprotocol/sdk": "1.15.1",
180
175
  "@mswjs/interceptors": "0.23.0",
181
176
  "@napi-rs/triples": "1.2.0",
182
- "@next/font": "15.4.2-canary.22",
183
- "@next/polyfill-module": "15.4.2-canary.22",
184
- "@next/polyfill-nomodule": "15.4.2-canary.22",
185
- "@next/react-refresh-utils": "15.4.2-canary.22",
186
- "@next/swc": "15.4.2-canary.22",
177
+ "@next/font": "15.4.2-canary.23",
178
+ "@next/polyfill-module": "15.4.2-canary.23",
179
+ "@next/polyfill-nomodule": "15.4.2-canary.23",
180
+ "@next/react-refresh-utils": "15.4.2-canary.23",
181
+ "@next/swc": "15.4.2-canary.23",
187
182
  "@opentelemetry/api": "1.6.0",
188
183
  "@playwright/test": "1.51.1",
189
184
  "@rspack/core": "1.4.5",
package/server.d.ts CHANGED
@@ -12,7 +12,7 @@ export { userAgentFromString } from 'next/dist/server/web/spec-extension/user-ag
12
12
  export { userAgent } from 'next/dist/server/web/spec-extension/user-agent'
13
13
  export { URLPattern } from 'next/dist/compiled/@edge-runtime/primitives/url'
14
14
  export { ImageResponse } from 'next/dist/server/web/spec-extension/image-response'
15
- export type { ImageResponseOptions } from 'next/dist/compiled/@vercel/og'
15
+ export type { ImageResponseOptions } from 'next/dist/compiled/@vercel/og/types'
16
16
  export { after } from 'next/dist/server/after'
17
17
  export { unstable_rootParams } from 'next/dist/server/request/root-params'
18
18
  export { connection } from 'next/dist/server/request/connection'
@@ -1,74 +0,0 @@
1
- import { SatoriOptions } from "next/dist/compiled/@vercel/og/satori";
2
- import { OutgoingHttpHeader } from 'http';
3
-
4
- declare const apis: {
5
- twemoji: (code: any) => string;
6
- openmoji: string;
7
- blobmoji: string;
8
- noto: string;
9
- fluent: (code: any) => string;
10
- fluentFlat: (code: any) => string;
11
- };
12
- type EmojiType = keyof typeof apis;
13
-
14
- type ImageOptions = {
15
- /**
16
- * The width of the image.
17
- *
18
- * @type {number}
19
- * @default 1200
20
- */
21
- width?: number;
22
- /**
23
- * The height of the image.
24
- *
25
- * @type {number}
26
- * @default 630
27
- */
28
- height?: number;
29
- /**
30
- * Display debug information on the image.
31
- *
32
- * @type {boolean}
33
- * @default false
34
- */
35
- debug?: boolean;
36
- /**
37
- * A list of fonts to use.
38
- *
39
- * @type {{ data: ArrayBuffer; name: string; weight?: 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900; style?: 'normal' | 'italic' }[]}
40
- * @default Noto Sans Latin Regular.
41
- */
42
- fonts?: SatoriOptions['fonts'];
43
- /**
44
- * Using a specific Emoji style. Defaults to `twemoji`.
45
- *
46
- * @type {EmojiType}
47
- * @default 'twemoji'
48
- */
49
- emoji?: EmojiType;
50
- };
51
- type ImageResponseNodeOptions = ImageOptions & {
52
- status?: number;
53
- statusText?: string;
54
- headers?: OutgoingHttpHeader[];
55
- };
56
- type ImageResponseOptions = ImageOptions & ConstructorParameters<typeof Response>[1];
57
- declare module 'react' {
58
- interface HTMLAttributes<T> {
59
- /**
60
- * Specify styles using Tailwind CSS classes. This feature is currently experimental.
61
- * If `style` prop is also specified, styles generated with `tw` prop will be overridden.
62
- *
63
- * Example:
64
- * - `tw='w-full h-full bg-blue-200'`
65
- * - `tw='text-9xl'`
66
- * - `tw='text-[80px]'`
67
- *
68
- * @type {string}
69
- */
70
- tw?: string;
71
- }
72
- }
73
-
74
- export { ImageResponseOptions as I, ImageResponseNodeOptions as a };