next 15.4.2-canary.17 → 15.4.2-canary.18

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 (57) hide show
  1. package/dist/bin/next +1 -1
  2. package/dist/build/index.js +19 -29
  3. package/dist/build/index.js.map +1 -1
  4. package/dist/build/swc/index.js +1 -1
  5. package/dist/build/webpack-config.js +2 -2
  6. package/dist/client/app-bootstrap.js +1 -1
  7. package/dist/client/index.js +1 -1
  8. package/dist/compiled/@vercel/og/emoji/index.d.ts +15 -0
  9. package/dist/compiled/@vercel/og/figma/index.d.ts +7 -0
  10. package/dist/compiled/@vercel/og/index.edge.d.ts +5 -9
  11. package/dist/compiled/@vercel/og/index.edge.js +2587 -3024
  12. package/dist/compiled/@vercel/og/index.node.d.ts +7 -10
  13. package/dist/compiled/@vercel/og/index.node.js +2585 -3022
  14. package/dist/compiled/@vercel/og/language/index.d.ts +28 -0
  15. package/dist/compiled/@vercel/og/og.d.ts +1 -0
  16. package/dist/compiled/@vercel/og/package.json +1 -1
  17. package/dist/compiled/@vercel/og/satori/index.d.ts +4 -1
  18. package/dist/compiled/@vercel/og/types.d.ts +118 -0
  19. package/dist/compiled/@vercel/og/yoga.wasm +0 -0
  20. package/dist/compiled/next-server/pages-api-turbo.runtime.dev.js +1 -1
  21. package/dist/compiled/next-server/pages-api-turbo.runtime.dev.js.map +1 -1
  22. package/dist/compiled/next-server/pages-api-turbo.runtime.prod.js +1 -1
  23. package/dist/compiled/next-server/pages-api-turbo.runtime.prod.js.map +1 -1
  24. package/dist/compiled/next-server/pages-api.runtime.dev.js +1 -1
  25. package/dist/compiled/next-server/pages-api.runtime.dev.js.map +1 -1
  26. package/dist/compiled/next-server/pages-turbo.runtime.dev.js +1 -1
  27. package/dist/compiled/next-server/pages-turbo.runtime.dev.js.map +1 -1
  28. package/dist/compiled/next-server/pages-turbo.runtime.prod.js +1 -1
  29. package/dist/compiled/next-server/pages-turbo.runtime.prod.js.map +1 -1
  30. package/dist/compiled/next-server/pages.runtime.dev.js +1 -1
  31. package/dist/compiled/next-server/pages.runtime.dev.js.map +1 -1
  32. package/dist/esm/build/index.js +20 -30
  33. package/dist/esm/build/index.js.map +1 -1
  34. package/dist/esm/build/swc/index.js +1 -1
  35. package/dist/esm/build/webpack-config.js +2 -2
  36. package/dist/esm/client/app-bootstrap.js +1 -1
  37. package/dist/esm/client/index.js +1 -1
  38. package/dist/esm/export/routes/app-page.js +4 -2
  39. package/dist/esm/export/routes/app-page.js.map +1 -1
  40. package/dist/esm/server/dev/hot-reloader-turbopack.js +1 -1
  41. package/dist/esm/server/dev/hot-reloader-webpack.js +1 -1
  42. package/dist/esm/server/lib/app-info-log.js +1 -1
  43. package/dist/esm/server/lib/start-server.js +1 -1
  44. package/dist/esm/shared/lib/canary-only.js +1 -1
  45. package/dist/export/routes/app-page.js +4 -2
  46. package/dist/export/routes/app-page.js.map +1 -1
  47. package/dist/server/dev/hot-reloader-turbopack.js +1 -1
  48. package/dist/server/dev/hot-reloader-webpack.js +1 -1
  49. package/dist/server/lib/app-info-log.js +1 -1
  50. package/dist/server/lib/start-server.js +1 -1
  51. package/dist/shared/lib/canary-only.js +1 -1
  52. package/dist/telemetry/anonymous-meta.js +1 -1
  53. package/dist/telemetry/events/session-stopped.js +2 -2
  54. package/dist/telemetry/events/version.js +2 -2
  55. package/package.json +15 -15
  56. package/server.d.ts +1 -1
  57. package/dist/compiled/@vercel/og/types-d38469ff.d.ts +0 -74
@@ -11,7 +11,7 @@ import { isDeepStrictEqual } from 'util';
11
11
  import { getDefineEnv } from '../define-env';
12
12
  import { getReactCompilerLoader } from '../get-babel-loader-config';
13
13
  import { throwTurbopackInternalError } from '../../shared/lib/turbopack/internal-error';
14
- const nextVersion = "15.4.2-canary.17";
14
+ const nextVersion = "15.4.2-canary.18";
15
15
  const ArchName = arch();
16
16
  const PlatformName = platform();
17
17
  function infoLog(...args) {
@@ -1593,7 +1593,7 @@ export default async function getBaseWebpackConfig(dir, { buildId, encryptionKey
1593
1593
  isClient && new CopyFilePlugin({
1594
1594
  // file path to build output of `@next/polyfill-nomodule`
1595
1595
  filePath: require.resolve('./polyfills/polyfill-nomodule'),
1596
- cacheKey: "15.4.2-canary.17",
1596
+ cacheKey: "15.4.2-canary.18",
1597
1597
  name: `static/chunks/polyfills${dev ? '' : '-[hash]'}.js`,
1598
1598
  minimize: false,
1599
1599
  info: {
@@ -1773,7 +1773,7 @@ export default async function getBaseWebpackConfig(dir, { buildId, encryptionKey
1773
1773
  // - Next.js location on disk (some loaders use absolute paths and some resolve options depend on absolute paths)
1774
1774
  // - Next.js version
1775
1775
  // - next.config.js keys that affect compilation
1776
- version: `${__dirname}|${"15.4.2-canary.17"}|${configVars}`,
1776
+ version: `${__dirname}|${"15.4.2-canary.18"}|${configVars}`,
1777
1777
  cacheDirectory: path.join(distDir, 'cache', 'webpack'),
1778
1778
  // For production builds, it's more efficient to compress all cache files together instead of compression each one individually.
1779
1779
  // So we disable compression here and allow the build runner to take care of compressing the cache as a whole.
@@ -4,7 +4,7 @@
4
4
  * - Polyfills
5
5
  * - next/script with `beforeInteractive` strategy
6
6
  */ import { setAttributesFromProps } from './set-attributes-from-props';
7
- const version = "15.4.2-canary.17";
7
+ const version = "15.4.2-canary.18";
8
8
  window.next = {
9
9
  version,
10
10
  appDir: true
@@ -26,7 +26,7 @@ import { SearchParamsContext, PathParamsContext } from '../shared/lib/hooks-clie
26
26
  import { onRecoverableError } from './react-client-callbacks/on-recoverable-error';
27
27
  import tracer from './tracing/tracer';
28
28
  import { isNextRouterError } from './components/is-next-router-error';
29
- export const version = "15.4.2-canary.17";
29
+ export const version = "15.4.2-canary.18";
30
30
  export let router;
31
31
  export const emitter = mitt();
32
32
  const looseToArray = (input)=>[].slice.call(input);
@@ -135,8 +135,10 @@ import { stringifyResumeDataCache } from '../../server/resume-data-cache/resume-
135
135
  };
136
136
  fileWriter.append(htmlFilepath.replace(/\.html$/, NEXT_META_SUFFIX), JSON.stringify(meta, null, 2));
137
137
  return {
138
- // Only include the metadata if the environment has next support.
139
- metadata: hasNextSupport ? meta : undefined,
138
+ // Filter the metadata if the environment does not have next support.
139
+ metadata: hasNextSupport ? meta : {
140
+ segmentPaths: meta.segmentPaths
141
+ },
140
142
  hasEmptyStaticShell: Boolean(postponed) && html === '',
141
143
  hasPostponed: Boolean(postponed),
142
144
  cacheControl,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/export/routes/app-page.ts"],"sourcesContent":["import type { OutgoingHttpHeaders } from 'node:http'\nimport type { ExportRouteResult } from '../types'\nimport type { RenderOpts } from '../../server/app-render/types'\nimport type { NextParsedUrlQuery } from '../../server/request-meta'\nimport type { RouteMetadata } from './types'\n\nimport type {\n MockedRequest,\n MockedResponse,\n} from '../../server/lib/mock-request'\nimport { isDynamicUsageError } from '../helpers/is-dynamic-usage-error'\nimport {\n NEXT_CACHE_TAGS_HEADER,\n NEXT_META_SUFFIX,\n RSC_PREFETCH_SUFFIX,\n RSC_SUFFIX,\n RSC_SEGMENTS_DIR_SUFFIX,\n RSC_SEGMENT_SUFFIX,\n} from '../../lib/constants'\nimport { hasNextSupport } from '../../server/ci-info'\nimport { lazyRenderAppPage } from '../../server/route-modules/app-page/module.render'\nimport { isBailoutToCSRError } from '../../shared/lib/lazy-dynamic/bailout-to-csr'\nimport { NodeNextRequest, NodeNextResponse } from '../../server/base-http/node'\nimport { NEXT_IS_PRERENDER_HEADER } from '../../client/components/app-router-headers'\nimport type { FetchMetrics } from '../../server/base-http'\nimport type { WorkStore } from '../../server/app-render/work-async-storage.external'\nimport type { FallbackRouteParams } from '../../server/request/fallback-params'\nimport { AfterRunner } from '../../server/after/run-with-after'\nimport type { RequestLifecycleOpts } from '../../server/base-server'\nimport type { AppSharedContext } from '../../server/app-render/app-render'\nimport type { MultiFileWriter } from '../../lib/multi-file-writer'\nimport { stringifyResumeDataCache } from '../../server/resume-data-cache/resume-data-cache'\n\n/**\n * Renders & exports a page associated with the /app directory\n */\nexport async function exportAppPage(\n req: MockedRequest,\n res: MockedResponse,\n page: string,\n path: string,\n pathname: string,\n query: NextParsedUrlQuery,\n fallbackRouteParams: FallbackRouteParams | null,\n partialRenderOpts: Omit<RenderOpts, keyof RequestLifecycleOpts>,\n htmlFilepath: string,\n debugOutput: boolean,\n isDynamicError: boolean,\n fileWriter: MultiFileWriter,\n sharedContext: AppSharedContext\n): Promise<ExportRouteResult> {\n const afterRunner = new AfterRunner()\n\n const renderOpts: RenderOpts = {\n ...partialRenderOpts,\n waitUntil: afterRunner.context.waitUntil,\n onClose: afterRunner.context.onClose,\n onAfterTaskError: afterRunner.context.onTaskError,\n }\n\n let isDefaultNotFound = false\n // If the page is `/_not-found`, then we should update the page to be `/404`.\n // UNDERSCORE_NOT_FOUND_ROUTE value used here, however we don't want to import it here as it causes constants to be inlined which we don't want here.\n if (page === '/_not-found/page') {\n isDefaultNotFound = true\n pathname = '/404'\n }\n\n try {\n const result = await lazyRenderAppPage(\n new NodeNextRequest(req),\n new NodeNextResponse(res),\n pathname,\n query,\n fallbackRouteParams,\n renderOpts,\n undefined,\n false,\n sharedContext\n )\n\n const html = result.toUnchunkedString()\n\n // TODO(after): if we abort a prerender because of an error in an after-callback\n // we should probably communicate that better (and not log the error twice)\n await afterRunner.executeAfter()\n\n const { metadata } = result\n const {\n flightData,\n cacheControl = { revalidate: false, expire: undefined },\n postponed,\n fetchTags,\n fetchMetrics,\n segmentData,\n renderResumeDataCache,\n } = metadata\n\n // Ensure we don't postpone without having PPR enabled.\n if (postponed && !renderOpts.experimental.isRoutePPREnabled) {\n throw new Error('Invariant: page postponed without PPR being enabled')\n }\n\n if (cacheControl.revalidate === 0) {\n if (isDynamicError) {\n throw new Error(\n `Page with dynamic = \"error\" encountered dynamic data method on ${path}.`\n )\n }\n const { staticBailoutInfo = {} } = metadata\n\n if (debugOutput && staticBailoutInfo?.description) {\n logDynamicUsageWarning({\n path,\n description: staticBailoutInfo.description,\n stack: staticBailoutInfo.stack,\n })\n }\n\n return { cacheControl, fetchMetrics }\n }\n\n // If page data isn't available, it means that the page couldn't be rendered\n // properly so long as we don't have unknown route params. When a route doesn't\n // have unknown route params, there will not be any flight data.\n if (\n !flightData &&\n (!fallbackRouteParams || fallbackRouteParams.size === 0)\n ) {\n throw new Error(`Invariant: failed to get page data for ${path}`)\n }\n\n if (flightData) {\n // If PPR is enabled, we want to emit a prefetch rsc file for the page\n // instead of the standard rsc. This is because the standard rsc will\n // contain the dynamic data. We do this if any routes have PPR enabled so\n // that the cache read/write is the same.\n if (renderOpts.experimental.isRoutePPREnabled) {\n // If PPR is enabled, we should emit the flight data as the prefetch\n // payload.\n // TODO: This will eventually be replaced by the per-segment prefetch\n // output below.\n fileWriter.append(\n htmlFilepath.replace(/\\.html$/, RSC_PREFETCH_SUFFIX),\n flightData\n )\n } else {\n // Writing the RSC payload to a file if we don't have PPR enabled.\n fileWriter.append(\n htmlFilepath.replace(/\\.html$/, RSC_SUFFIX),\n flightData\n )\n }\n }\n\n let segmentPaths\n if (segmentData) {\n // Emit the per-segment prefetch data. We emit them as separate files\n // so that the cache handler has the option to treat each as a\n // separate entry.\n segmentPaths = []\n const segmentsDir = htmlFilepath.replace(\n /\\.html$/,\n RSC_SEGMENTS_DIR_SUFFIX\n )\n\n for (const [segmentPath, buffer] of segmentData) {\n segmentPaths.push(segmentPath)\n const segmentDataFilePath =\n segmentsDir + segmentPath + RSC_SEGMENT_SUFFIX\n fileWriter.append(segmentDataFilePath, buffer)\n }\n }\n\n const headers: OutgoingHttpHeaders = { ...metadata.headers }\n\n // If we're writing the file to disk, we know it's a prerender.\n headers[NEXT_IS_PRERENDER_HEADER] = '1'\n\n if (fetchTags) {\n headers[NEXT_CACHE_TAGS_HEADER] = fetchTags\n }\n\n // Writing static HTML to a file.\n fileWriter.append(htmlFilepath, html)\n\n const isParallelRoute = /\\/@\\w+/.test(page)\n const isNonSuccessfulStatusCode = res.statusCode > 300\n\n // When PPR is enabled, we don't always send 200 for routes that have been\n // pregenerated, so we should grab the status code from the mocked\n // response.\n let status: number | undefined = renderOpts.experimental.isRoutePPREnabled\n ? res.statusCode\n : undefined\n\n if (isDefaultNotFound) {\n // Override the default /_not-found page status code to 404\n status = 404\n } else if (isNonSuccessfulStatusCode && !isParallelRoute) {\n // If it's parallel route the status from mock response is 404\n status = res.statusCode\n }\n\n // Writing the request metadata to a file.\n const meta: RouteMetadata = {\n status,\n headers,\n postponed,\n segmentPaths,\n }\n\n fileWriter.append(\n htmlFilepath.replace(/\\.html$/, NEXT_META_SUFFIX),\n JSON.stringify(meta, null, 2)\n )\n\n return {\n // Only include the metadata if the environment has next support.\n metadata: hasNextSupport ? meta : undefined,\n hasEmptyStaticShell: Boolean(postponed) && html === '',\n hasPostponed: Boolean(postponed),\n cacheControl,\n fetchMetrics,\n renderResumeDataCache: renderResumeDataCache\n ? await stringifyResumeDataCache(renderResumeDataCache)\n : undefined,\n }\n } catch (err) {\n if (!isDynamicUsageError(err)) {\n throw err\n }\n\n // We should fail rendering if a client side rendering bailout\n // occurred at the page level.\n if (isBailoutToCSRError(err)) {\n throw err\n }\n\n let fetchMetrics: FetchMetrics | undefined\n\n if (debugOutput) {\n const store = (renderOpts as any).store as WorkStore\n const { dynamicUsageDescription, dynamicUsageStack } = store\n fetchMetrics = store.fetchMetrics\n\n logDynamicUsageWarning({\n path,\n description: dynamicUsageDescription ?? '',\n stack: dynamicUsageStack,\n })\n }\n\n return { cacheControl: { revalidate: 0, expire: undefined }, fetchMetrics }\n }\n}\n\nfunction logDynamicUsageWarning({\n path,\n description,\n stack,\n}: {\n path: string\n description: string\n stack?: string\n}) {\n const errMessage = new Error(\n `Static generation failed due to dynamic usage on ${path}, reason: ${description}`\n )\n\n if (stack) {\n errMessage.stack = errMessage.message + stack.substring(stack.indexOf('\\n'))\n }\n\n console.warn(errMessage)\n}\n"],"names":["isDynamicUsageError","NEXT_CACHE_TAGS_HEADER","NEXT_META_SUFFIX","RSC_PREFETCH_SUFFIX","RSC_SUFFIX","RSC_SEGMENTS_DIR_SUFFIX","RSC_SEGMENT_SUFFIX","hasNextSupport","lazyRenderAppPage","isBailoutToCSRError","NodeNextRequest","NodeNextResponse","NEXT_IS_PRERENDER_HEADER","AfterRunner","stringifyResumeDataCache","exportAppPage","req","res","page","path","pathname","query","fallbackRouteParams","partialRenderOpts","htmlFilepath","debugOutput","isDynamicError","fileWriter","sharedContext","afterRunner","renderOpts","waitUntil","context","onClose","onAfterTaskError","onTaskError","isDefaultNotFound","result","undefined","html","toUnchunkedString","executeAfter","metadata","flightData","cacheControl","revalidate","expire","postponed","fetchTags","fetchMetrics","segmentData","renderResumeDataCache","experimental","isRoutePPREnabled","Error","staticBailoutInfo","description","logDynamicUsageWarning","stack","size","append","replace","segmentPaths","segmentsDir","segmentPath","buffer","push","segmentDataFilePath","headers","isParallelRoute","test","isNonSuccessfulStatusCode","statusCode","status","meta","JSON","stringify","hasEmptyStaticShell","Boolean","hasPostponed","err","store","dynamicUsageDescription","dynamicUsageStack","errMessage","message","substring","indexOf","console","warn"],"mappings":"AAUA,SAASA,mBAAmB,QAAQ,oCAAmC;AACvE,SACEC,sBAAsB,EACtBC,gBAAgB,EAChBC,mBAAmB,EACnBC,UAAU,EACVC,uBAAuB,EACvBC,kBAAkB,QACb,sBAAqB;AAC5B,SAASC,cAAc,QAAQ,uBAAsB;AACrD,SAASC,iBAAiB,QAAQ,oDAAmD;AACrF,SAASC,mBAAmB,QAAQ,+CAA8C;AAClF,SAASC,eAAe,EAAEC,gBAAgB,QAAQ,8BAA6B;AAC/E,SAASC,wBAAwB,QAAQ,6CAA4C;AAIrF,SAASC,WAAW,QAAQ,oCAAmC;AAI/D,SAASC,wBAAwB,QAAQ,mDAAkD;AAE3F;;CAEC,GACD,OAAO,eAAeC,cACpBC,GAAkB,EAClBC,GAAmB,EACnBC,IAAY,EACZC,IAAY,EACZC,QAAgB,EAChBC,KAAyB,EACzBC,mBAA+C,EAC/CC,iBAA+D,EAC/DC,YAAoB,EACpBC,WAAoB,EACpB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AAEC,YAAY;gBAAGC,QAAQR;YAAU;YAAGW;QAAa;IAC5E;AACF;AAEA,SAASQ,uBAAuB,EAC9BtC,IAAI,EACJqC,WAAW,EACXE,KAAK,EAKN;IACC,MAAM0B,aAAa,qBAElB,CAFkB,IAAI9B,MACrB,CAAC,iDAAiD,EAAEnC,KAAK,UAAU,EAAEqC,aAAa,GADjE,qBAAA;eAAA;oBAAA;sBAAA;IAEnB;IAEA,IAAIE,OAAO;QACT0B,WAAW1B,KAAK,GAAG0B,WAAWC,OAAO,GAAG3B,MAAM4B,SAAS,CAAC5B,MAAM6B,OAAO,CAAC;IACxE;IAEAC,QAAQC,IAAI,CAACL;AACf","ignoreList":[0]}
1
+ {"version":3,"sources":["../../../src/export/routes/app-page.ts"],"sourcesContent":["import type { OutgoingHttpHeaders } from 'node:http'\nimport type { ExportRouteResult } from '../types'\nimport type { RenderOpts } from '../../server/app-render/types'\nimport type { NextParsedUrlQuery } from '../../server/request-meta'\nimport type { RouteMetadata } from './types'\n\nimport type {\n MockedRequest,\n MockedResponse,\n} from '../../server/lib/mock-request'\nimport { isDynamicUsageError } from '../helpers/is-dynamic-usage-error'\nimport {\n NEXT_CACHE_TAGS_HEADER,\n NEXT_META_SUFFIX,\n RSC_PREFETCH_SUFFIX,\n RSC_SUFFIX,\n RSC_SEGMENTS_DIR_SUFFIX,\n RSC_SEGMENT_SUFFIX,\n} from '../../lib/constants'\nimport { hasNextSupport } from '../../server/ci-info'\nimport { lazyRenderAppPage } from '../../server/route-modules/app-page/module.render'\nimport { isBailoutToCSRError } from '../../shared/lib/lazy-dynamic/bailout-to-csr'\nimport { NodeNextRequest, NodeNextResponse } from '../../server/base-http/node'\nimport { NEXT_IS_PRERENDER_HEADER } from '../../client/components/app-router-headers'\nimport type { FetchMetrics } from '../../server/base-http'\nimport type { WorkStore } from '../../server/app-render/work-async-storage.external'\nimport type { FallbackRouteParams } from '../../server/request/fallback-params'\nimport { AfterRunner } from '../../server/after/run-with-after'\nimport type { RequestLifecycleOpts } from '../../server/base-server'\nimport type { AppSharedContext } from '../../server/app-render/app-render'\nimport type { MultiFileWriter } from '../../lib/multi-file-writer'\nimport { stringifyResumeDataCache } from '../../server/resume-data-cache/resume-data-cache'\n\n/**\n * Renders & exports a page associated with the /app directory\n */\nexport async function exportAppPage(\n req: MockedRequest,\n res: MockedResponse,\n page: string,\n path: string,\n pathname: string,\n query: NextParsedUrlQuery,\n fallbackRouteParams: FallbackRouteParams | null,\n partialRenderOpts: Omit<RenderOpts, keyof RequestLifecycleOpts>,\n htmlFilepath: string,\n debugOutput: boolean,\n isDynamicError: boolean,\n fileWriter: MultiFileWriter,\n sharedContext: AppSharedContext\n): Promise<ExportRouteResult> {\n const afterRunner = new AfterRunner()\n\n const renderOpts: RenderOpts = {\n ...partialRenderOpts,\n waitUntil: afterRunner.context.waitUntil,\n onClose: afterRunner.context.onClose,\n onAfterTaskError: afterRunner.context.onTaskError,\n }\n\n let isDefaultNotFound = false\n // If the page is `/_not-found`, then we should update the page to be `/404`.\n // UNDERSCORE_NOT_FOUND_ROUTE value used here, however we don't want to import it here as it causes constants to be inlined which we don't want here.\n if (page === '/_not-found/page') {\n isDefaultNotFound = true\n pathname = '/404'\n }\n\n try {\n const result = await lazyRenderAppPage(\n new NodeNextRequest(req),\n new NodeNextResponse(res),\n pathname,\n query,\n fallbackRouteParams,\n renderOpts,\n undefined,\n false,\n sharedContext\n )\n\n const html = result.toUnchunkedString()\n\n // TODO(after): if we abort a prerender because of an error in an after-callback\n // we should probably communicate that better (and not log the error twice)\n await afterRunner.executeAfter()\n\n const { metadata } = result\n const {\n flightData,\n cacheControl = { revalidate: false, expire: undefined },\n postponed,\n fetchTags,\n fetchMetrics,\n segmentData,\n renderResumeDataCache,\n } = metadata\n\n // Ensure we don't postpone without having PPR enabled.\n if (postponed && !renderOpts.experimental.isRoutePPREnabled) {\n throw new Error('Invariant: page postponed without PPR being enabled')\n }\n\n if (cacheControl.revalidate === 0) {\n if (isDynamicError) {\n throw new Error(\n `Page with dynamic = \"error\" encountered dynamic data method on ${path}.`\n )\n }\n const { staticBailoutInfo = {} } = metadata\n\n if (debugOutput && staticBailoutInfo?.description) {\n logDynamicUsageWarning({\n path,\n description: staticBailoutInfo.description,\n stack: staticBailoutInfo.stack,\n })\n }\n\n return { cacheControl, fetchMetrics }\n }\n\n // If page data isn't available, it means that the page couldn't be rendered\n // properly so long as we don't have unknown route params. When a route doesn't\n // have unknown route params, there will not be any flight data.\n if (\n !flightData &&\n (!fallbackRouteParams || fallbackRouteParams.size === 0)\n ) {\n throw new Error(`Invariant: failed to get page data for ${path}`)\n }\n\n if (flightData) {\n // If PPR is enabled, we want to emit a prefetch rsc file for the page\n // instead of the standard rsc. This is because the standard rsc will\n // contain the dynamic data. We do this if any routes have PPR enabled so\n // that the cache read/write is the same.\n if (renderOpts.experimental.isRoutePPREnabled) {\n // If PPR is enabled, we should emit the flight data as the prefetch\n // payload.\n // TODO: This will eventually be replaced by the per-segment prefetch\n // output below.\n fileWriter.append(\n htmlFilepath.replace(/\\.html$/, RSC_PREFETCH_SUFFIX),\n flightData\n )\n } else {\n // Writing the RSC payload to a file if we don't have PPR enabled.\n fileWriter.append(\n htmlFilepath.replace(/\\.html$/, RSC_SUFFIX),\n flightData\n )\n }\n }\n\n let segmentPaths\n if (segmentData) {\n // Emit the per-segment prefetch data. We emit them as separate files\n // so that the cache handler has the option to treat each as a\n // separate entry.\n segmentPaths = []\n const segmentsDir = htmlFilepath.replace(\n /\\.html$/,\n RSC_SEGMENTS_DIR_SUFFIX\n )\n\n for (const [segmentPath, buffer] of segmentData) {\n segmentPaths.push(segmentPath)\n const segmentDataFilePath =\n segmentsDir + segmentPath + RSC_SEGMENT_SUFFIX\n fileWriter.append(segmentDataFilePath, buffer)\n }\n }\n\n const headers: OutgoingHttpHeaders = { ...metadata.headers }\n\n // If we're writing the file to disk, we know it's a prerender.\n headers[NEXT_IS_PRERENDER_HEADER] = '1'\n\n if (fetchTags) {\n headers[NEXT_CACHE_TAGS_HEADER] = fetchTags\n }\n\n // Writing static HTML to a file.\n fileWriter.append(htmlFilepath, html)\n\n const isParallelRoute = /\\/@\\w+/.test(page)\n const isNonSuccessfulStatusCode = res.statusCode > 300\n\n // When PPR is enabled, we don't always send 200 for routes that have been\n // pregenerated, so we should grab the status code from the mocked\n // response.\n let status: number | undefined = renderOpts.experimental.isRoutePPREnabled\n ? res.statusCode\n : undefined\n\n if (isDefaultNotFound) {\n // Override the default /_not-found page status code to 404\n status = 404\n } else if (isNonSuccessfulStatusCode && !isParallelRoute) {\n // If it's parallel route the status from mock response is 404\n status = res.statusCode\n }\n\n // Writing the request metadata to a file.\n const meta: RouteMetadata = {\n status,\n headers,\n postponed,\n segmentPaths,\n }\n\n fileWriter.append(\n htmlFilepath.replace(/\\.html$/, NEXT_META_SUFFIX),\n JSON.stringify(meta, null, 2)\n )\n\n return {\n // Filter the metadata if the environment does not have next support.\n metadata: hasNextSupport\n ? meta\n : {\n segmentPaths: meta.segmentPaths,\n },\n hasEmptyStaticShell: Boolean(postponed) && html === '',\n hasPostponed: Boolean(postponed),\n cacheControl,\n fetchMetrics,\n renderResumeDataCache: renderResumeDataCache\n ? await stringifyResumeDataCache(renderResumeDataCache)\n : undefined,\n }\n } catch (err) {\n if (!isDynamicUsageError(err)) {\n throw err\n }\n\n // We should fail rendering if a client side rendering bailout\n // occurred at the page level.\n if (isBailoutToCSRError(err)) {\n throw err\n }\n\n let fetchMetrics: FetchMetrics | undefined\n\n if (debugOutput) {\n const store = (renderOpts as any).store as WorkStore\n const { dynamicUsageDescription, dynamicUsageStack } = store\n fetchMetrics = store.fetchMetrics\n\n logDynamicUsageWarning({\n path,\n description: dynamicUsageDescription ?? '',\n stack: dynamicUsageStack,\n })\n }\n\n return { cacheControl: { revalidate: 0, expire: undefined }, fetchMetrics }\n }\n}\n\nfunction logDynamicUsageWarning({\n path,\n description,\n stack,\n}: {\n path: string\n description: string\n stack?: string\n}) {\n const errMessage = new Error(\n `Static generation failed due to dynamic usage on ${path}, reason: ${description}`\n )\n\n if (stack) {\n errMessage.stack = errMessage.message + stack.substring(stack.indexOf('\\n'))\n }\n\n console.warn(errMessage)\n}\n"],"names":["isDynamicUsageError","NEXT_CACHE_TAGS_HEADER","NEXT_META_SUFFIX","RSC_PREFETCH_SUFFIX","RSC_SUFFIX","RSC_SEGMENTS_DIR_SUFFIX","RSC_SEGMENT_SUFFIX","hasNextSupport","lazyRenderAppPage","isBailoutToCSRError","NodeNextRequest","NodeNextResponse","NEXT_IS_PRERENDER_HEADER","AfterRunner","stringifyResumeDataCache","exportAppPage","req","res","page","path","pathname","query","fallbackRouteParams","partialRenderOpts","htmlFilepath","debugOutput","isDynamicError","fileWriter","sharedContext","afterRunner","renderOpts","waitUntil","context","onClose","onAfterTaskError","onTaskError","isDefaultNotFound","result","undefined","html","toUnchunkedString","executeAfter","metadata","flightData","cacheControl","revalidate","expire","postponed","fetchTags","fetchMetrics","segmentData","renderResumeDataCache","experimental","isRoutePPREnabled","Error","staticBailoutInfo","description","logDynamicUsageWarning","stack","size","append","replace","segmentPaths","segmentsDir","segmentPath","buffer","push","segmentDataFilePath","headers","isParallelRoute","test","isNonSuccessfulStatusCode","statusCode","status","meta","JSON","stringify","hasEmptyStaticShell","Boolean","hasPostponed","err","store","dynamicUsageDescription","dynamicUsageStack","errMessage","message","substring","indexOf","console","warn"],"mappings":"AAUA,SAASA,mBAAmB,QAAQ,oCAAmC;AACvE,SACEC,sBAAsB,EACtBC,gBAAgB,EAChBC,mBAAmB,EACnBC,UAAU,EACVC,uBAAuB,EACvBC,kBAAkB,QACb,sBAAqB;AAC5B,SAASC,cAAc,QAAQ,uBAAsB;AACrD,SAASC,iBAAiB,QAAQ,oDAAmD;AACrF,SAASC,mBAAmB,QAAQ,+CAA8C;AAClF,SAASC,eAAe,EAAEC,gBAAgB,QAAQ,8BAA6B;AAC/E,SAASC,wBAAwB,QAAQ,6CAA4C;AAIrF,SAASC,WAAW,QAAQ,oCAAmC;AAI/D,SA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f,MAAMwD,QAAQ,AAACnD,WAAmBmD,KAAK;YACvC,MAAM,EAAEC,uBAAuB,EAAEC,iBAAiB,EAAE,GAAGF;YACvDhC,eAAegC,MAAMhC,YAAY;YAEjCQ,uBAAuB;gBACrBtC;gBACAqC,aAAa0B,2BAA2B;gBACxCxB,OAAOyB;YACT;QACF;QAEA,OAAO;YAAEvC,cAAc;gBAAEC,YAAY;gBAAGC,QAAQR;YAAU;YAAGW;QAAa;IAC5E;AACF;AAEA,SAASQ,uBAAuB,EAC9BtC,IAAI,EACJqC,WAAW,EACXE,KAAK,EAKN;IACC,MAAM0B,aAAa,qBAElB,CAFkB,IAAI9B,MACrB,CAAC,iDAAiD,EAAEnC,KAAK,UAAU,EAAEqC,aAAa,GADjE,qBAAA;eAAA;oBAAA;sBAAA;IAEnB;IAEA,IAAIE,OAAO;QACT0B,WAAW1B,KAAK,GAAG0B,WAAWC,OAAO,GAAG3B,MAAM4B,SAAS,CAAC5B,MAAM6B,OAAO,CAAC;IACxE;IAEAC,QAAQC,IAAI,CAACL;AACf","ignoreList":[0]}
@@ -89,7 +89,7 @@ export async function createHotReloaderTurbopack(opts, serverFields, distDir, re
89
89
  }
90
90
  const hasRewrites = opts.fsChecker.rewrites.afterFiles.length > 0 || opts.fsChecker.rewrites.beforeFiles.length > 0 || opts.fsChecker.rewrites.fallback.length > 0;
91
91
  const hotReloaderSpan = trace('hot-reloader', undefined, {
92
- version: "15.4.2-canary.17"
92
+ version: "15.4.2-canary.18"
93
93
  });
94
94
  // Ensure the hotReloaderSpan is flushed immediately as it's the parentSpan for all processing
95
95
  // of the current `next dev` invocation.
@@ -186,7 +186,7 @@ export default class HotReloaderWebpack {
186
186
  this.previewProps = previewProps;
187
187
  this.rewrites = rewrites;
188
188
  this.hotReloaderSpan = trace('hot-reloader', undefined, {
189
- version: "15.4.2-canary.17"
189
+ version: "15.4.2-canary.18"
190
190
  });
191
191
  // Ensure the hotReloaderSpan is flushed immediately as it's the parentSpan for all processing
192
192
  // of the current `next dev` invocation.
@@ -12,7 +12,7 @@ export function logStartInfo({ networkUrl, appUrl, envInfo, experimentalFeatures
12
12
  } else {
13
13
  bundlerSuffix = '';
14
14
  }
15
- Log.bootstrap(`${bold(purple(`${Log.prefixes.ready} Next.js ${"15.4.2-canary.17"}`))}${bundlerSuffix}`);
15
+ Log.bootstrap(`${bold(purple(`${Log.prefixes.ready} Next.js ${"15.4.2-canary.18"}`))}${bundlerSuffix}`);
16
16
  if (appUrl) {
17
17
  Log.bootstrap(`- Local: ${appUrl}`);
18
18
  }
@@ -111,7 +111,7 @@ export async function getRequestHandlers({ dir, port, isDev, onDevServerCleanup,
111
111
  export async function startServer(serverOptions) {
112
112
  const { dir, isDev, hostname, minimalMode, allowRetry, keepAliveTimeout, selfSignedCertificate } = serverOptions;
113
113
  let { port } = serverOptions;
114
- process.title = `next-server (v${"15.4.2-canary.17"})`;
114
+ process.title = `next-server (v${"15.4.2-canary.18"})`;
115
115
  let handlersReady = ()=>{};
116
116
  let handlersError = ()=>{};
117
117
  let handlersPromise = new Promise((resolve, reject)=>{
@@ -1,6 +1,6 @@
1
1
  export function isStableBuild() {
2
2
  var _process_env___NEXT_VERSION;
3
- return !((_process_env___NEXT_VERSION = "15.4.2-canary.17") == null ? void 0 : _process_env___NEXT_VERSION.includes('canary')) && !process.env.__NEXT_TEST_MODE && !process.env.NEXT_PRIVATE_LOCAL_DEV;
3
+ return !((_process_env___NEXT_VERSION = "15.4.2-canary.18") == null ? void 0 : _process_env___NEXT_VERSION.includes('canary')) && !process.env.__NEXT_TEST_MODE && !process.env.NEXT_PRIVATE_LOCAL_DEV;
4
4
  }
5
5
  export class CanaryOnlyError extends Error {
6
6
  constructor(arg){
@@ -143,8 +143,10 @@ async function exportAppPage(req, res, page, path, pathname, query, fallbackRout
143
143
  };
144
144
  fileWriter.append(htmlFilepath.replace(/\.html$/, _constants.NEXT_META_SUFFIX), JSON.stringify(meta, null, 2));
145
145
  return {
146
- // Only include the metadata if the environment has next support.
147
- metadata: _ciinfo.hasNextSupport ? meta : undefined,
146
+ // Filter the metadata if the environment does not have next support.
147
+ metadata: _ciinfo.hasNextSupport ? meta : {
148
+ segmentPaths: meta.segmentPaths
149
+ },
148
150
  hasEmptyStaticShell: Boolean(postponed) && html === '',
149
151
  hasPostponed: Boolean(postponed),
150
152
  cacheControl,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/export/routes/app-page.ts"],"sourcesContent":["import type { OutgoingHttpHeaders } from 'node:http'\nimport type { ExportRouteResult } from '../types'\nimport type { RenderOpts } from '../../server/app-render/types'\nimport type { NextParsedUrlQuery } from '../../server/request-meta'\nimport type { RouteMetadata } from './types'\n\nimport type {\n MockedRequest,\n MockedResponse,\n} from '../../server/lib/mock-request'\nimport { isDynamicUsageError } from '../helpers/is-dynamic-usage-error'\nimport {\n NEXT_CACHE_TAGS_HEADER,\n NEXT_META_SUFFIX,\n RSC_PREFETCH_SUFFIX,\n RSC_SUFFIX,\n RSC_SEGMENTS_DIR_SUFFIX,\n RSC_SEGMENT_SUFFIX,\n} from '../../lib/constants'\nimport { hasNextSupport } from '../../server/ci-info'\nimport { lazyRenderAppPage } from '../../server/route-modules/app-page/module.render'\nimport { isBailoutToCSRError } from '../../shared/lib/lazy-dynamic/bailout-to-csr'\nimport { NodeNextRequest, NodeNextResponse } from '../../server/base-http/node'\nimport { NEXT_IS_PRERENDER_HEADER } from '../../client/components/app-router-headers'\nimport type { FetchMetrics } from '../../server/base-http'\nimport type { WorkStore } from '../../server/app-render/work-async-storage.external'\nimport type { FallbackRouteParams } from '../../server/request/fallback-params'\nimport { AfterRunner } from '../../server/after/run-with-after'\nimport type { RequestLifecycleOpts } from '../../server/base-server'\nimport type { AppSharedContext } from '../../server/app-render/app-render'\nimport type { MultiFileWriter } from '../../lib/multi-file-writer'\nimport { stringifyResumeDataCache } from '../../server/resume-data-cache/resume-data-cache'\n\n/**\n * Renders & exports a page associated with the /app directory\n */\nexport async function exportAppPage(\n req: MockedRequest,\n res: MockedResponse,\n page: string,\n path: string,\n pathname: string,\n query: NextParsedUrlQuery,\n fallbackRouteParams: FallbackRouteParams | null,\n partialRenderOpts: Omit<RenderOpts, keyof RequestLifecycleOpts>,\n htmlFilepath: string,\n debugOutput: boolean,\n isDynamicError: boolean,\n fileWriter: MultiFileWriter,\n sharedContext: AppSharedContext\n): Promise<ExportRouteResult> {\n const afterRunner = new AfterRunner()\n\n const renderOpts: RenderOpts = {\n ...partialRenderOpts,\n waitUntil: afterRunner.context.waitUntil,\n onClose: afterRunner.context.onClose,\n onAfterTaskError: afterRunner.context.onTaskError,\n }\n\n let isDefaultNotFound = false\n // If the page is `/_not-found`, then we should update the page to be `/404`.\n // UNDERSCORE_NOT_FOUND_ROUTE value used here, however we don't want to import it here as it causes constants to be inlined which we don't want here.\n if (page === '/_not-found/page') {\n isDefaultNotFound = true\n pathname = '/404'\n }\n\n try {\n const result = await lazyRenderAppPage(\n new NodeNextRequest(req),\n new NodeNextResponse(res),\n pathname,\n query,\n fallbackRouteParams,\n renderOpts,\n undefined,\n false,\n sharedContext\n )\n\n const html = result.toUnchunkedString()\n\n // TODO(after): if we abort a prerender because of an error in an after-callback\n // we should probably communicate that better (and not log the error twice)\n await afterRunner.executeAfter()\n\n const { metadata } = result\n const {\n flightData,\n cacheControl = { revalidate: false, expire: undefined },\n postponed,\n fetchTags,\n fetchMetrics,\n segmentData,\n renderResumeDataCache,\n } = metadata\n\n // Ensure we don't postpone without having PPR enabled.\n if (postponed && !renderOpts.experimental.isRoutePPREnabled) {\n throw new Error('Invariant: page postponed without PPR being enabled')\n }\n\n if (cacheControl.revalidate === 0) {\n if (isDynamicError) {\n throw new Error(\n `Page with dynamic = \"error\" encountered dynamic data method on ${path}.`\n )\n }\n const { staticBailoutInfo = {} } = metadata\n\n if (debugOutput && staticBailoutInfo?.description) {\n logDynamicUsageWarning({\n path,\n description: staticBailoutInfo.description,\n stack: staticBailoutInfo.stack,\n })\n }\n\n return { cacheControl, fetchMetrics }\n }\n\n // If page data isn't available, it means that the page couldn't be rendered\n // properly so long as we don't have unknown route params. When a route doesn't\n // have unknown route params, there will not be any flight data.\n if (\n !flightData &&\n (!fallbackRouteParams || fallbackRouteParams.size === 0)\n ) {\n throw new Error(`Invariant: failed to get page data for ${path}`)\n }\n\n if (flightData) {\n // If PPR is enabled, we want to emit a prefetch rsc file for the page\n // instead of the standard rsc. This is because the standard rsc will\n // contain the dynamic data. We do this if any routes have PPR enabled so\n // that the cache read/write is the same.\n if (renderOpts.experimental.isRoutePPREnabled) {\n // If PPR is enabled, we should emit the flight data as the prefetch\n // payload.\n // TODO: This will eventually be replaced by the per-segment prefetch\n // output below.\n fileWriter.append(\n htmlFilepath.replace(/\\.html$/, RSC_PREFETCH_SUFFIX),\n flightData\n )\n } else {\n // Writing the RSC payload to a file if we don't have PPR enabled.\n fileWriter.append(\n htmlFilepath.replace(/\\.html$/, RSC_SUFFIX),\n flightData\n )\n }\n }\n\n let segmentPaths\n if (segmentData) {\n // Emit the per-segment prefetch data. We emit them as separate files\n // so that the cache handler has the option to treat each as a\n // separate entry.\n segmentPaths = []\n const segmentsDir = htmlFilepath.replace(\n /\\.html$/,\n RSC_SEGMENTS_DIR_SUFFIX\n )\n\n for (const [segmentPath, buffer] of segmentData) {\n segmentPaths.push(segmentPath)\n const segmentDataFilePath =\n segmentsDir + segmentPath + RSC_SEGMENT_SUFFIX\n fileWriter.append(segmentDataFilePath, buffer)\n }\n }\n\n const headers: OutgoingHttpHeaders = { ...metadata.headers }\n\n // If we're writing the file to disk, we know it's a prerender.\n headers[NEXT_IS_PRERENDER_HEADER] = '1'\n\n if (fetchTags) {\n headers[NEXT_CACHE_TAGS_HEADER] = fetchTags\n }\n\n // Writing static HTML to a file.\n fileWriter.append(htmlFilepath, html)\n\n const isParallelRoute = /\\/@\\w+/.test(page)\n const isNonSuccessfulStatusCode = res.statusCode > 300\n\n // When PPR is enabled, we don't always send 200 for routes that have been\n // pregenerated, so we should grab the status code from the mocked\n // response.\n let status: number | undefined = renderOpts.experimental.isRoutePPREnabled\n ? res.statusCode\n : undefined\n\n if (isDefaultNotFound) {\n // Override the default /_not-found page status code to 404\n status = 404\n } else if (isNonSuccessfulStatusCode && !isParallelRoute) {\n // If it's parallel route the status from mock response is 404\n status = res.statusCode\n }\n\n // Writing the request metadata to a file.\n const meta: RouteMetadata = {\n status,\n headers,\n postponed,\n segmentPaths,\n }\n\n fileWriter.append(\n htmlFilepath.replace(/\\.html$/, NEXT_META_SUFFIX),\n JSON.stringify(meta, null, 2)\n )\n\n return {\n // Only include the metadata if the environment has next support.\n metadata: hasNextSupport ? meta : undefined,\n hasEmptyStaticShell: Boolean(postponed) && html === '',\n hasPostponed: Boolean(postponed),\n cacheControl,\n fetchMetrics,\n renderResumeDataCache: renderResumeDataCache\n ? await stringifyResumeDataCache(renderResumeDataCache)\n : undefined,\n }\n } catch (err) {\n if (!isDynamicUsageError(err)) {\n throw err\n }\n\n // We should fail rendering if a client side rendering bailout\n // occurred at the page level.\n if (isBailoutToCSRError(err)) {\n throw err\n }\n\n let fetchMetrics: FetchMetrics | undefined\n\n if (debugOutput) {\n const store = (renderOpts as any).store as WorkStore\n const { dynamicUsageDescription, dynamicUsageStack } = store\n fetchMetrics = store.fetchMetrics\n\n logDynamicUsageWarning({\n path,\n description: dynamicUsageDescription ?? '',\n stack: dynamicUsageStack,\n })\n }\n\n return { cacheControl: { revalidate: 0, expire: undefined }, fetchMetrics }\n }\n}\n\nfunction logDynamicUsageWarning({\n path,\n description,\n stack,\n}: {\n path: string\n description: string\n stack?: string\n}) {\n const errMessage = new Error(\n `Static generation failed due to dynamic usage on ${path}, reason: ${description}`\n )\n\n if (stack) {\n errMessage.stack = errMessage.message + stack.substring(stack.indexOf('\\n'))\n }\n\n console.warn(errMessage)\n}\n"],"names":["exportAppPage","req","res","page","path","pathname","query","fallbackRouteParams","partialRenderOpts","htmlFilepath","debugOutput","isDynamicError","fileWriter","sharedContext","afterRunner","AfterRunner","renderOpts","waitUntil","context","onClose","onAfterTaskError","onTaskError","isDefaultNotFound","result","lazyRenderAppPage","NodeNextRequest","NodeNextResponse","undefined","html","toUnchunkedString","executeAfter","metadata","flightData","cacheControl","revalidate","expire","postponed","fetchTags","fetchMetrics","segmentData","renderResumeDataCache","experimental","isRoutePPREnabled","Error","staticBailoutInfo","description","logDynamicUsageWarning","stack","size","append","replace","RSC_PREFETCH_SUFFIX","RSC_SUFFIX","segmentPaths","segmentsDir","RSC_SEGMENTS_DIR_SUFFIX","segmentPath","buffer","push","segmentDataFilePath","RSC_SEGMENT_SUFFIX","headers","NEXT_IS_PRERENDER_HEADER","NEXT_CACHE_TAGS_HEADER","isParallelRoute","test","isNonSuccessfulStatusCode","statusCode","status","meta","NEXT_META_SUFFIX","JSON","stringify","hasNextSupport","hasEmptyStaticShell","Boolean","hasPostponed","stringifyResumeDataCache","err","isDynamicUsageError","isBailoutToCSRError","store","dynamicUsageDescription","dynamicUsageStack","errMessage","message","substring","indexOf","console","warn"],"mappings":";;;;+BAoCsBA;;;eAAAA;;;qCA1Bc;2BAQ7B;wBACwB;8BACG;8BACE;sBACc;kCACT;8BAIb;iCAIa;AAKlC,eAAeA,cACpBC,GAAkB,EAClBC,GAAmB,EACnBC,IAAY,EACZC,IAAY,EACZC,QAAgB,EAChBC,KAAyB,EACzBC,mBAA+C,EAC/CC,iBAA+D,EAC/DC,YAAoB,EACpBC,WAAoB,EACpBC,cAAuB,EACvBC,UAA2B,EAC3BC,aAA+B;IAE/B,MAAMC,cAAc,IAAIC,yBAAW;IAEnC,MAAMC,aAAyB;QAC7B,GAAGR,iBAAiB;QACpBS,WAAWH,YAAYI,OAAO,CAACD,SAAS;QACxCE,SAASL,YAAYI,OAAO,CAACC,OAAO;QACpCC,kBAAkBN,YAAYI,OAAO,CAACG,WAAW;IACnD;IAEA,IAAIC,oBAAoB;IACxB,6EAA6E;IAC7E,qJAAqJ;IACrJ,IAAInB,SAAS,oBAAoB;QAC/BmB,oBAAoB;QACpBjB,WAAW;IACb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EnB;IAEA,IAAIE,OAAO;QACTqC,WAAWrC,KAAK,GAAGqC,WAAWC,OAAO,GAAGtC,MAAMuC,SAAS,CAACvC,MAAMwC,OAAO,CAAC;IACxE;IAEAC,QAAQC,IAAI,CAACL;AACf","ignoreList":[0]}
1
+ {"version":3,"sources":["../../../src/export/routes/app-page.ts"],"sourcesContent":["import type { OutgoingHttpHeaders } from 'node:http'\nimport type { ExportRouteResult } from '../types'\nimport type { RenderOpts } from '../../server/app-render/types'\nimport type { NextParsedUrlQuery } from '../../server/request-meta'\nimport type { RouteMetadata } from './types'\n\nimport type {\n MockedRequest,\n MockedResponse,\n} from '../../server/lib/mock-request'\nimport { isDynamicUsageError } from '../helpers/is-dynamic-usage-error'\nimport {\n NEXT_CACHE_TAGS_HEADER,\n NEXT_META_SUFFIX,\n RSC_PREFETCH_SUFFIX,\n RSC_SUFFIX,\n RSC_SEGMENTS_DIR_SUFFIX,\n RSC_SEGMENT_SUFFIX,\n} from '../../lib/constants'\nimport { hasNextSupport } from '../../server/ci-info'\nimport { lazyRenderAppPage } from '../../server/route-modules/app-page/module.render'\nimport { isBailoutToCSRError } from '../../shared/lib/lazy-dynamic/bailout-to-csr'\nimport { NodeNextRequest, NodeNextResponse } from '../../server/base-http/node'\nimport { NEXT_IS_PRERENDER_HEADER } from '../../client/components/app-router-headers'\nimport type { FetchMetrics } from '../../server/base-http'\nimport type { WorkStore } from '../../server/app-render/work-async-storage.external'\nimport type { FallbackRouteParams } from '../../server/request/fallback-params'\nimport { AfterRunner } from '../../server/after/run-with-after'\nimport type { RequestLifecycleOpts } from '../../server/base-server'\nimport type { AppSharedContext } from '../../server/app-render/app-render'\nimport type { MultiFileWriter } from '../../lib/multi-file-writer'\nimport { stringifyResumeDataCache } from '../../server/resume-data-cache/resume-data-cache'\n\n/**\n * Renders & exports a page associated with the /app directory\n */\nexport async function exportAppPage(\n req: MockedRequest,\n res: MockedResponse,\n page: string,\n path: string,\n pathname: string,\n query: NextParsedUrlQuery,\n fallbackRouteParams: FallbackRouteParams | null,\n partialRenderOpts: Omit<RenderOpts, keyof RequestLifecycleOpts>,\n htmlFilepath: string,\n debugOutput: boolean,\n isDynamicError: boolean,\n fileWriter: MultiFileWriter,\n sharedContext: AppSharedContext\n): Promise<ExportRouteResult> {\n const afterRunner = new AfterRunner()\n\n const renderOpts: RenderOpts = {\n ...partialRenderOpts,\n waitUntil: afterRunner.context.waitUntil,\n onClose: afterRunner.context.onClose,\n onAfterTaskError: afterRunner.context.onTaskError,\n }\n\n let isDefaultNotFound = false\n // If the page is `/_not-found`, then we should update the page to be `/404`.\n // UNDERSCORE_NOT_FOUND_ROUTE value used here, however we don't want to import it here as it causes constants to be inlined which we don't want here.\n if (page === '/_not-found/page') {\n isDefaultNotFound = true\n pathname = '/404'\n }\n\n try {\n const result = await lazyRenderAppPage(\n new NodeNextRequest(req),\n new NodeNextResponse(res),\n pathname,\n query,\n fallbackRouteParams,\n renderOpts,\n undefined,\n false,\n sharedContext\n )\n\n const html = result.toUnchunkedString()\n\n // TODO(after): if we abort a prerender because of an error in an after-callback\n // we should probably communicate that better (and not log the error twice)\n await afterRunner.executeAfter()\n\n const { metadata } = result\n const {\n flightData,\n cacheControl = { revalidate: false, expire: undefined },\n postponed,\n fetchTags,\n fetchMetrics,\n segmentData,\n renderResumeDataCache,\n } = metadata\n\n // Ensure we don't postpone without having PPR enabled.\n if (postponed && !renderOpts.experimental.isRoutePPREnabled) {\n throw new Error('Invariant: page postponed without PPR being enabled')\n }\n\n if (cacheControl.revalidate === 0) {\n if (isDynamicError) {\n throw new Error(\n `Page with dynamic = \"error\" encountered dynamic data method on ${path}.`\n )\n }\n const { staticBailoutInfo = {} } = metadata\n\n if (debugOutput && staticBailoutInfo?.description) {\n logDynamicUsageWarning({\n path,\n description: staticBailoutInfo.description,\n stack: staticBailoutInfo.stack,\n })\n }\n\n return { cacheControl, fetchMetrics }\n }\n\n // If page data isn't available, it means that the page couldn't be rendered\n // properly so long as we don't have unknown route params. When a route doesn't\n // have unknown route params, there will not be any flight data.\n if (\n !flightData &&\n (!fallbackRouteParams || fallbackRouteParams.size === 0)\n ) {\n throw new Error(`Invariant: failed to get page data for ${path}`)\n }\n\n if (flightData) {\n // If PPR is enabled, we want to emit a prefetch rsc file for the page\n // instead of the standard rsc. This is because the standard rsc will\n // contain the dynamic data. We do this if any routes have PPR enabled so\n // that the cache read/write is the same.\n if (renderOpts.experimental.isRoutePPREnabled) {\n // If PPR is enabled, we should emit the flight data as the prefetch\n // payload.\n // TODO: This will eventually be replaced by the per-segment prefetch\n // output below.\n fileWriter.append(\n htmlFilepath.replace(/\\.html$/, RSC_PREFETCH_SUFFIX),\n flightData\n )\n } else {\n // Writing the RSC payload to a file if we don't have PPR enabled.\n fileWriter.append(\n htmlFilepath.replace(/\\.html$/, RSC_SUFFIX),\n flightData\n )\n }\n }\n\n let segmentPaths\n if (segmentData) {\n // Emit the per-segment prefetch data. We emit them as separate files\n // so that the cache handler has the option to treat each as a\n // separate entry.\n segmentPaths = []\n const segmentsDir = htmlFilepath.replace(\n /\\.html$/,\n RSC_SEGMENTS_DIR_SUFFIX\n )\n\n for (const [segmentPath, buffer] of segmentData) {\n segmentPaths.push(segmentPath)\n const segmentDataFilePath =\n segmentsDir + segmentPath + RSC_SEGMENT_SUFFIX\n fileWriter.append(segmentDataFilePath, buffer)\n }\n }\n\n const headers: OutgoingHttpHeaders = { ...metadata.headers }\n\n // If we're writing the file to disk, we know it's a prerender.\n headers[NEXT_IS_PRERENDER_HEADER] = '1'\n\n if (fetchTags) {\n headers[NEXT_CACHE_TAGS_HEADER] = fetchTags\n }\n\n // Writing static HTML to a file.\n fileWriter.append(htmlFilepath, html)\n\n const isParallelRoute = /\\/@\\w+/.test(page)\n const isNonSuccessfulStatusCode = res.statusCode > 300\n\n // When PPR is enabled, we don't always send 200 for routes that have been\n // pregenerated, so we should grab the status code from the mocked\n // response.\n let status: number | undefined = renderOpts.experimental.isRoutePPREnabled\n ? res.statusCode\n : undefined\n\n if (isDefaultNotFound) {\n // Override the default /_not-found page status code to 404\n status = 404\n } else if (isNonSuccessfulStatusCode && !isParallelRoute) {\n // If it's parallel route the status from mock response is 404\n status = res.statusCode\n }\n\n // Writing the request metadata to a file.\n const meta: RouteMetadata = {\n status,\n headers,\n postponed,\n segmentPaths,\n }\n\n fileWriter.append(\n htmlFilepath.replace(/\\.html$/, NEXT_META_SUFFIX),\n JSON.stringify(meta, null, 2)\n )\n\n return {\n // Filter the metadata if the environment does not have next support.\n metadata: hasNextSupport\n ? meta\n : {\n segmentPaths: meta.segmentPaths,\n },\n hasEmptyStaticShell: Boolean(postponed) && html === '',\n hasPostponed: Boolean(postponed),\n cacheControl,\n fetchMetrics,\n renderResumeDataCache: renderResumeDataCache\n ? await stringifyResumeDataCache(renderResumeDataCache)\n : undefined,\n }\n } catch (err) {\n if (!isDynamicUsageError(err)) {\n throw err\n }\n\n // We should fail rendering if a client side rendering bailout\n // occurred at the page level.\n if (isBailoutToCSRError(err)) {\n throw err\n }\n\n let fetchMetrics: FetchMetrics | undefined\n\n if (debugOutput) {\n const store = (renderOpts as any).store as WorkStore\n const { dynamicUsageDescription, dynamicUsageStack } = store\n fetchMetrics = store.fetchMetrics\n\n logDynamicUsageWarning({\n path,\n description: dynamicUsageDescription ?? '',\n stack: dynamicUsageStack,\n })\n }\n\n return { cacheControl: { revalidate: 0, expire: undefined }, fetchMetrics }\n }\n}\n\nfunction logDynamicUsageWarning({\n path,\n description,\n stack,\n}: {\n path: string\n description: string\n stack?: string\n}) {\n const errMessage = new Error(\n `Static generation failed due to dynamic usage on ${path}, reason: ${description}`\n )\n\n if (stack) {\n errMessage.stack = errMessage.message + stack.substring(stack.indexOf('\\n'))\n }\n\n console.warn(errMessage)\n}\n"],"names":["exportAppPage","req","res","page","path","pathname","query","fallbackRouteParams","partialRenderOpts","htmlFilepath","debugOutput","isDynamicError","fileWriter","sharedContext","afterRunner","AfterRunner","renderOpts","waitUntil","context","onClose","onAfterTaskError","onTaskError","isDefaultNotFound","result","lazyRenderAppPage","NodeNextRequest","NodeNextResponse","undefined","html","toUnchunkedString","executeAfter","metadata","flightData","cacheControl","revalidate","expire","postponed","fetchTags","fetchMetrics","segmentData","renderResumeDataCache","experimental","isRoutePPREnabled","Error","staticBailoutInfo","description","logDynamicUsageWarning","stack","size","append","replace","RSC_PREFETCH_SUFFIX","RSC_SUFFIX","segmentPaths","segmentsDir","RSC_SEGMENTS_DIR_SUFFIX","segmentPath","buffer","push","segmentDataFilePath","RSC_SEGMENT_SUFFIX","headers","NEXT_IS_PRERENDER_HEADER","NEXT_CACHE_TAGS_HEADER","isParallelRoute","test","isNonSuccessfulStatusCode","statusCode","status","meta","NEXT_META_SUFFIX","JSON","stringify","hasNextSupport","hasEmptyStaticShell","Boolean","hasPostponed","stringifyResumeDataCache","err","isDynamicUsageError","isBailoutToCSRError","store","dynamicUsageDescription","dynamicUsageStack","errMessage","message","substring","indexOf","console","warn"],"mappings":";;;;+BAoCsBA;;;eAAAA;;;qCA1Bc;2BAQ7B;wBACwB;8BACG;8BACE;sBACc;kCACT;8BAIb;iCAIa;AAKlC,eAAeA,cACpBC,GAAkB,EAClBC,GAAmB,EACnBC,IAAY,EACZC,IAAY,EACZC,QAAgB,EAChBC,KAAyB,EACzBC,mBAA+C,EAC/CC,iBAA+D,EAC/DC,YAAoB,EACpBC,WAAoB,EACpBC,cAAuB,EACvBC,UAA2B,EAC3BC,aAA+B;IAE/B,MAAMC,cAAc,IAAIC,yBAAW;IAEnC,MAAMC,aAAyB;QAC7B,GAAGR,iBAAiB;QACpBS,WAAWH,YAAYI,OAAO,CAACD,SAAS;QACxCE,SAASL,YAAYI,OAAO,CAACC,OAAO;QACpCC,kBAAkBN,YAAYI,OAAO,CAACG,WAAW;IACnD;IAEA,IAAIC,oBAAoB;IACxB,6EAA6E;IAC7E,qJAAqJ;IACrJ,IAAInB,SAAS,oBAAoB;QAC/BmB,oBAAoB;QACpBjB,WAAW;IACb;IAEA,IAAI;QACF,MAAMkB,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AA;IAEnB;IAEA,IAAIE,OAAO;QACTqC,WAAWrC,KAAK,GAAGqC,WAAWC,OAAO,GAAGtC,MAAMuC,SAAS,CAACvC,MAAMwC,OAAO,CAAC;IACxE;IAEAC,QAAQC,IAAI,CAACL;AACf","ignoreList":[0]}
@@ -145,7 +145,7 @@ async function createHotReloaderTurbopack(opts, serverFields, distDir, resetFetc
145
145
  }
146
146
  const hasRewrites = opts.fsChecker.rewrites.afterFiles.length > 0 || opts.fsChecker.rewrites.beforeFiles.length > 0 || opts.fsChecker.rewrites.fallback.length > 0;
147
147
  const hotReloaderSpan = (0, _trace.trace)('hot-reloader', undefined, {
148
- version: "15.4.2-canary.17"
148
+ version: "15.4.2-canary.18"
149
149
  });
150
150
  // Ensure the hotReloaderSpan is flushed immediately as it's the parentSpan for all processing
151
151
  // of the current `next dev` invocation.
@@ -262,7 +262,7 @@ class HotReloaderWebpack {
262
262
  this.previewProps = previewProps;
263
263
  this.rewrites = rewrites;
264
264
  this.hotReloaderSpan = (0, _trace.trace)('hot-reloader', undefined, {
265
- version: "15.4.2-canary.17"
265
+ version: "15.4.2-canary.18"
266
266
  });
267
267
  // Ensure the hotReloaderSpan is flushed immediately as it's the parentSpan for all processing
268
268
  // of the current `next dev` invocation.
@@ -80,7 +80,7 @@ function logStartInfo({ networkUrl, appUrl, envInfo, experimentalFeatures, maxEx
80
80
  } else {
81
81
  bundlerSuffix = '';
82
82
  }
83
- _log.bootstrap(`${(0, _picocolors.bold)((0, _picocolors.purple)(`${_log.prefixes.ready} Next.js ${"15.4.2-canary.17"}`))}${bundlerSuffix}`);
83
+ _log.bootstrap(`${(0, _picocolors.bold)((0, _picocolors.purple)(`${_log.prefixes.ready} Next.js ${"15.4.2-canary.18"}`))}${bundlerSuffix}`);
84
84
  if (appUrl) {
85
85
  _log.bootstrap(`- Local: ${appUrl}`);
86
86
  }
@@ -179,7 +179,7 @@ async function getRequestHandlers({ dir, port, isDev, onDevServerCleanup, server
179
179
  async function startServer(serverOptions) {
180
180
  const { dir, isDev, hostname, minimalMode, allowRetry, keepAliveTimeout, selfSignedCertificate } = serverOptions;
181
181
  let { port } = serverOptions;
182
- process.title = `next-server (v${"15.4.2-canary.17"})`;
182
+ process.title = `next-server (v${"15.4.2-canary.18"})`;
183
183
  let handlersReady = ()=>{};
184
184
  let handlersError = ()=>{};
185
185
  let handlersPromise = new Promise((resolve, reject)=>{
@@ -22,7 +22,7 @@ _export(exports, {
22
22
  });
23
23
  function isStableBuild() {
24
24
  var _process_env___NEXT_VERSION;
25
- return !((_process_env___NEXT_VERSION = "15.4.2-canary.17") == null ? void 0 : _process_env___NEXT_VERSION.includes('canary')) && !process.env.__NEXT_TEST_MODE && !process.env.NEXT_PRIVATE_LOCAL_DEV;
25
+ return !((_process_env___NEXT_VERSION = "15.4.2-canary.18") == null ? void 0 : _process_env___NEXT_VERSION.includes('canary')) && !process.env.__NEXT_TEST_MODE && !process.env.NEXT_PRIVATE_LOCAL_DEV;
26
26
  }
27
27
  class CanaryOnlyError extends Error {
28
28
  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: "15.4.2-canary.17"
84
+ nextVersion: "15.4.2-canary.18"
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.17" !== 'string') {
14
+ if (typeof "15.4.2-canary.18" !== 'string') {
15
15
  return [];
16
16
  }
17
17
  const payload = {
18
- nextVersion: "15.4.2-canary.17",
18
+ nextVersion: "15.4.2-canary.18",
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.17" !== 'string') {
39
+ if (typeof "15.4.2-canary.18" !== 'string') {
40
40
  return [];
41
41
  }
42
42
  const { images, i18n } = nextConfig || {};
43
43
  const payload = {
44
- nextVersion: "15.4.2-canary.17",
44
+ nextVersion: "15.4.2-canary.18",
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.17",
3
+ "version": "15.4.2-canary.18",
4
4
  "description": "The React Framework",
5
5
  "main": "./dist/server/next.js",
6
6
  "license": "MIT",
@@ -100,7 +100,7 @@
100
100
  ]
101
101
  },
102
102
  "dependencies": {
103
- "@next/env": "15.4.2-canary.17",
103
+ "@next/env": "15.4.2-canary.18",
104
104
  "@swc/helpers": "0.5.15",
105
105
  "caniuse-lite": "^1.0.30001579",
106
106
  "postcss": "8.4.31",
@@ -134,14 +134,14 @@
134
134
  },
135
135
  "optionalDependencies": {
136
136
  "sharp": "^0.34.3",
137
- "@next/swc-darwin-arm64": "15.4.2-canary.17",
138
- "@next/swc-darwin-x64": "15.4.2-canary.17",
139
- "@next/swc-linux-arm64-gnu": "15.4.2-canary.17",
140
- "@next/swc-linux-arm64-musl": "15.4.2-canary.17",
141
- "@next/swc-linux-x64-gnu": "15.4.2-canary.17",
142
- "@next/swc-linux-x64-musl": "15.4.2-canary.17",
143
- "@next/swc-win32-arm64-msvc": "15.4.2-canary.17",
144
- "@next/swc-win32-x64-msvc": "15.4.2-canary.17"
137
+ "@next/swc-darwin-arm64": "15.4.2-canary.18",
138
+ "@next/swc-darwin-x64": "15.4.2-canary.18",
139
+ "@next/swc-linux-arm64-gnu": "15.4.2-canary.18",
140
+ "@next/swc-linux-arm64-musl": "15.4.2-canary.18",
141
+ "@next/swc-linux-x64-gnu": "15.4.2-canary.18",
142
+ "@next/swc-linux-x64-musl": "15.4.2-canary.18",
143
+ "@next/swc-win32-arm64-msvc": "15.4.2-canary.18",
144
+ "@next/swc-win32-x64-msvc": "15.4.2-canary.18"
145
145
  },
146
146
  "devDependencies": {
147
147
  "@ampproject/toolbox-optimizer": "2.8.3",
@@ -177,11 +177,11 @@
177
177
  "@modelcontextprotocol/sdk": "1.15.1",
178
178
  "@mswjs/interceptors": "0.23.0",
179
179
  "@napi-rs/triples": "1.2.0",
180
- "@next/font": "15.4.2-canary.17",
181
- "@next/polyfill-module": "15.4.2-canary.17",
182
- "@next/polyfill-nomodule": "15.4.2-canary.17",
183
- "@next/react-refresh-utils": "15.4.2-canary.17",
184
- "@next/swc": "15.4.2-canary.17",
180
+ "@next/font": "15.4.2-canary.18",
181
+ "@next/polyfill-module": "15.4.2-canary.18",
182
+ "@next/polyfill-nomodule": "15.4.2-canary.18",
183
+ "@next/react-refresh-utils": "15.4.2-canary.18",
184
+ "@next/swc": "15.4.2-canary.18",
185
185
  "@opentelemetry/api": "1.6.0",
186
186
  "@playwright/test": "1.51.1",
187
187
  "@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 };