next 15.1.1-canary.3 → 15.1.1-canary.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of next might be problematic. Click here for more details.
- package/dist/bin/next +1 -1
- package/dist/build/index.js +2 -2
- package/dist/build/swc/generated-native.d.ts +33 -29
- package/dist/build/swc/index.js +1 -1
- package/dist/build/utils.js +6 -3
- package/dist/build/utils.js.map +1 -1
- package/dist/build/webpack-config.js +2 -2
- package/dist/client/app-bootstrap.js +1 -1
- package/dist/client/index.js +1 -1
- package/dist/compiled/next-server/server.runtime.prod.js +1 -1
- package/dist/compiled/next-server/server.runtime.prod.js.map +1 -1
- package/dist/esm/build/index.js +2 -2
- package/dist/esm/build/swc/generated-native.d.ts +33 -29
- package/dist/esm/build/swc/index.js +1 -1
- package/dist/esm/build/utils.js +6 -3
- package/dist/esm/build/utils.js.map +1 -1
- package/dist/esm/build/webpack-config.js +2 -2
- package/dist/esm/client/app-bootstrap.js +1 -1
- package/dist/esm/client/index.js +1 -1
- package/dist/esm/export/worker.js +2 -1
- package/dist/esm/export/worker.js.map +1 -1
- package/dist/esm/server/config.js +1 -1
- package/dist/esm/server/dev/hot-reloader-turbopack.js +1 -1
- package/dist/esm/server/dev/hot-reloader-webpack.js +1 -1
- package/dist/esm/server/dev/static-paths-worker.js +2 -1
- package/dist/esm/server/dev/static-paths-worker.js.map +1 -1
- package/dist/esm/server/lib/app-info-log.js +1 -1
- package/dist/esm/server/lib/start-server.js +1 -1
- package/dist/esm/server/load-components.js +13 -8
- package/dist/esm/server/load-components.js.map +1 -1
- package/dist/esm/server/next-server.js +11 -5
- package/dist/esm/server/next-server.js.map +1 -1
- package/dist/export/worker.js +2 -1
- package/dist/export/worker.js.map +1 -1
- package/dist/server/config.js +1 -1
- package/dist/server/dev/hot-reloader-turbopack.js +1 -1
- package/dist/server/dev/hot-reloader-webpack.js +1 -1
- package/dist/server/dev/static-paths-worker.js +2 -1
- package/dist/server/dev/static-paths-worker.js.map +1 -1
- package/dist/server/lib/app-info-log.js +1 -1
- package/dist/server/lib/start-server.js +1 -1
- package/dist/server/load-components.d.ts +2 -1
- package/dist/server/load-components.js +13 -8
- package/dist/server/load-components.js.map +1 -1
- package/dist/server/next-server.d.ts +1 -0
- package/dist/server/next-server.js +11 -5
- package/dist/server/next-server.js.map +1 -1
- package/dist/telemetry/anonymous-meta.js +1 -1
- package/dist/telemetry/events/session-stopped.js +2 -2
- package/dist/telemetry/events/version.js +2 -2
- package/package.json +15 -15
|
@@ -1390,7 +1390,7 @@ export default async function getBaseWebpackConfig(dir, { buildId, encryptionKey
|
|
|
1390
1390
|
isClient && new CopyFilePlugin({
|
|
1391
1391
|
// file path to build output of `@next/polyfill-nomodule`
|
|
1392
1392
|
filePath: require.resolve('./polyfills/polyfill-nomodule'),
|
|
1393
|
-
cacheKey: "15.1.1-canary.
|
|
1393
|
+
cacheKey: "15.1.1-canary.5",
|
|
1394
1394
|
name: `static/chunks/polyfills${dev ? '' : '-[hash]'}.js`,
|
|
1395
1395
|
minimize: false,
|
|
1396
1396
|
info: {
|
|
@@ -1618,7 +1618,7 @@ export default async function getBaseWebpackConfig(dir, { buildId, encryptionKey
|
|
|
1618
1618
|
// - Next.js location on disk (some loaders use absolute paths and some resolve options depend on absolute paths)
|
|
1619
1619
|
// - Next.js version
|
|
1620
1620
|
// - next.config.js keys that affect compilation
|
|
1621
|
-
version: `${__dirname}|${"15.1.1-canary.
|
|
1621
|
+
version: `${__dirname}|${"15.1.1-canary.5"}|${configVars}`,
|
|
1622
1622
|
cacheDirectory: path.join(distDir, 'cache', 'webpack'),
|
|
1623
1623
|
// For production builds, it's more efficient to compress all cache files together instead of compression each one individually.
|
|
1624
1624
|
// So we disable compression here and allow the build runner to take care of compressing the cache as a whole.
|
package/dist/esm/client/index.js
CHANGED
|
@@ -27,7 +27,7 @@ import { onRecoverableError } from './react-client-callbacks/shared';
|
|
|
27
27
|
import tracer from './tracing/tracer';
|
|
28
28
|
import reportToSocket from './tracing/report-to-socket';
|
|
29
29
|
import { isNextRouterError } from './components/is-next-router-error';
|
|
30
|
-
export const version = "15.1.1-canary.
|
|
30
|
+
export const version = "15.1.1-canary.5";
|
|
31
31
|
export let router;
|
|
32
32
|
export const emitter = mitt();
|
|
33
33
|
const looseToArray = (input)=>[].slice.call(input);
|
|
@@ -149,7 +149,8 @@ async function exportPageImpl(input, fileWriter) {
|
|
|
149
149
|
const components = await loadComponents({
|
|
150
150
|
distDir,
|
|
151
151
|
page,
|
|
152
|
-
isAppPath: isAppDir
|
|
152
|
+
isAppPath: isAppDir,
|
|
153
|
+
isDev: false
|
|
153
154
|
});
|
|
154
155
|
// Handle App Routes.
|
|
155
156
|
if (isAppDir && isAppRouteRoute(page)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/export/worker.ts"],"sourcesContent":["import type {\n ExportPagesInput,\n ExportPageInput,\n ExportPageResult,\n ExportRouteResult,\n ExportedPageFile,\n FileWriter,\n WorkerRenderOpts,\n ExportPagesResult,\n} from './types'\n\nimport '../server/node-environment'\n\nprocess.env.NEXT_IS_EXPORT_WORKER = 'true'\n\nimport { extname, join, dirname, sep } from 'path'\nimport fs from 'fs/promises'\nimport { loadComponents } from '../server/load-components'\nimport { isDynamicRoute } from '../shared/lib/router/utils/is-dynamic'\nimport { normalizePagePath } from '../shared/lib/page-path/normalize-page-path'\nimport { normalizeLocalePath } from '../shared/lib/i18n/normalize-locale-path'\nimport { trace } from '../trace'\nimport { setHttpClientAndAgentOptions } from '../server/setup-http-agent-env'\nimport isError from '../lib/is-error'\nimport { addRequestMeta } from '../server/request-meta'\nimport { normalizeAppPath } from '../shared/lib/router/utils/app-paths'\n\nimport { createRequestResponseMocks } from '../server/lib/mock-request'\nimport { isAppRouteRoute } from '../lib/is-app-route-route'\nimport { hasNextSupport } from '../server/ci-info'\nimport { exportAppRoute } from './routes/app-route'\nimport { exportAppPage, prospectiveRenderAppPage } from './routes/app-page'\nimport { exportPagesPage } from './routes/pages'\nimport { getParams } from './helpers/get-params'\nimport { createIncrementalCache } from './helpers/create-incremental-cache'\nimport { isPostpone } from '../server/lib/router-utils/is-postpone'\nimport { isDynamicUsageError } from './helpers/is-dynamic-usage-error'\nimport { isBailoutToCSRError } from '../shared/lib/lazy-dynamic/bailout-to-csr'\nimport {\n turborepoTraceAccess,\n TurborepoAccessTraceResult,\n} from '../build/turborepo-access-trace'\nimport type { Params } from '../server/request/params'\nimport {\n getFallbackRouteParams,\n type FallbackRouteParams,\n} from '../server/request/fallback-params'\nimport { needsExperimentalReact } from '../lib/needs-experimental-react'\nimport type { AppRouteRouteModule } from '../server/route-modules/app-route/module.compiled'\nimport { isStaticGenBailoutError } from '../client/components/static-generation-bailout'\n\nconst envConfig = require('../shared/lib/runtime-config.external')\n\n;(globalThis as any).__NEXT_DATA__ = {\n nextExport: true,\n}\n\nclass TimeoutError extends Error {\n code = 'NEXT_EXPORT_TIMEOUT_ERROR'\n}\n\nclass ExportPageError extends Error {\n code = 'NEXT_EXPORT_PAGE_ERROR'\n}\n\nasync function exportPageImpl(\n input: ExportPageInput,\n fileWriter: FileWriter\n): Promise<ExportRouteResult | undefined> {\n const {\n path,\n pathMap,\n distDir,\n pagesDataDir,\n buildExport = false,\n serverRuntimeConfig,\n subFolders = false,\n optimizeCss,\n disableOptimizedLoading,\n debugOutput = false,\n enableExperimentalReact,\n ampValidatorPath,\n trailingSlash,\n } = input\n\n if (enableExperimentalReact) {\n process.env.__NEXT_EXPERIMENTAL_REACT = 'true'\n }\n\n const {\n page,\n\n // The parameters that are currently unknown.\n _fallbackRouteParams = [],\n\n // Check if this is an `app/` page.\n _isAppDir: isAppDir = false,\n\n // Check if this should error when dynamic usage is detected.\n _isDynamicError: isDynamicError = false,\n\n // If this page supports partial prerendering, then we need to pass that to\n // the renderOpts.\n _isRoutePPREnabled: isRoutePPREnabled,\n\n // If this is a prospective render, we don't actually want to persist the\n // result, we just want to use it to error the build if there's a problem.\n _isProspectiveRender: isProspectiveRender = false,\n\n // Pull the original query out.\n query: originalQuery = {},\n } = pathMap\n\n const fallbackRouteParams: FallbackRouteParams | null =\n getFallbackRouteParams(_fallbackRouteParams)\n\n let query = { ...originalQuery }\n const pathname = normalizeAppPath(page)\n const isDynamic = isDynamicRoute(page)\n const outDir = isAppDir ? join(distDir, 'server/app') : input.outDir\n\n const filePath = normalizePagePath(path)\n const ampPath = `${filePath}.amp`\n let renderAmpPath = ampPath\n\n let updatedPath = query.__nextSsgPath || path\n delete query.__nextSsgPath\n\n let locale = query.__nextLocale || input.renderOpts.locale\n delete query.__nextLocale\n\n if (input.renderOpts.locale) {\n const localePathResult = normalizeLocalePath(path, input.renderOpts.locales)\n\n if (localePathResult.detectedLocale) {\n updatedPath = localePathResult.pathname\n locale = localePathResult.detectedLocale\n\n if (locale === input.renderOpts.defaultLocale) {\n renderAmpPath = `${normalizePagePath(updatedPath)}.amp`\n }\n }\n }\n\n // We need to show a warning if they try to provide query values\n // for an auto-exported page since they won't be available\n const hasOrigQueryValues = Object.keys(originalQuery).length > 0\n\n // Check if the page is a specified dynamic route\n const { pathname: nonLocalizedPath } = normalizeLocalePath(\n path,\n input.renderOpts.locales\n )\n\n let params: Params | undefined\n\n if (isDynamic && page !== nonLocalizedPath) {\n const normalizedPage = isAppDir ? normalizeAppPath(page) : page\n\n params = getParams(normalizedPage, updatedPath)\n }\n\n const { req, res } = createRequestResponseMocks({ url: updatedPath })\n\n // If this is a status code page, then set the response code.\n for (const statusCode of [404, 500]) {\n if (\n [\n `/${statusCode}`,\n `/${statusCode}.html`,\n `/${statusCode}/index.html`,\n ].some((p) => p === updatedPath || `/${locale}${p}` === updatedPath)\n ) {\n res.statusCode = statusCode\n }\n }\n\n // Ensure that the URL has a trailing slash if it's configured.\n if (trailingSlash && !req.url?.endsWith('/')) {\n req.url += '/'\n }\n\n if (\n locale &&\n buildExport &&\n input.renderOpts.domainLocales &&\n input.renderOpts.domainLocales.some(\n (dl) => dl.defaultLocale === locale || dl.locales?.includes(locale || '')\n )\n ) {\n addRequestMeta(req, 'isLocaleDomain', true)\n }\n\n envConfig.setConfig({\n serverRuntimeConfig,\n publicRuntimeConfig: input.renderOpts.runtimeConfig,\n })\n\n const getHtmlFilename = (p: string) =>\n subFolders ? `${p}${sep}index.html` : `${p}.html`\n\n let htmlFilename = getHtmlFilename(filePath)\n\n // dynamic routes can provide invalid extensions e.g. /blog/[...slug] returns an\n // extension of `.slug]`\n const pageExt = isDynamic || isAppDir ? '' : extname(page)\n const pathExt = isDynamic || isAppDir ? '' : extname(path)\n\n // force output 404.html for backwards compat\n if (path === '/404.html') {\n htmlFilename = path\n }\n // Make sure page isn't a folder with a dot in the name e.g. `v1.2`\n else if (pageExt !== pathExt && pathExt !== '') {\n const isBuiltinPaths = ['/500', '/404'].some(\n (p) => p === path || p === path + '.html'\n )\n // If the ssg path has .html extension, and it's not builtin paths, use it directly\n // Otherwise, use that as the filename instead\n const isHtmlExtPath = !isBuiltinPaths && path.endsWith('.html')\n htmlFilename = isHtmlExtPath ? getHtmlFilename(path) : path\n } else if (path === '/') {\n // If the path is the root, just use index.html\n htmlFilename = 'index.html'\n }\n\n const baseDir = join(outDir, dirname(htmlFilename))\n let htmlFilepath = join(outDir, htmlFilename)\n\n await fs.mkdir(baseDir, { recursive: true })\n\n const components = await loadComponents({\n distDir,\n page,\n isAppPath: isAppDir,\n })\n\n // Handle App Routes.\n if (isAppDir && isAppRouteRoute(page)) {\n return exportAppRoute(\n req,\n res,\n params,\n page,\n components.routeModule as AppRouteRouteModule,\n input.renderOpts.incrementalCache,\n input.renderOpts.cacheLifeProfiles,\n htmlFilepath,\n fileWriter,\n input.renderOpts.experimental,\n input.renderOpts.buildId\n )\n }\n\n const renderOpts: WorkerRenderOpts = {\n ...components,\n ...input.renderOpts,\n ampPath: renderAmpPath,\n params,\n optimizeCss,\n disableOptimizedLoading,\n locale,\n supportsDynamicResponse: false,\n experimental: {\n ...input.renderOpts.experimental,\n isRoutePPREnabled,\n },\n }\n\n if (hasNextSupport) {\n renderOpts.isRevalidate = true\n }\n\n // Handle App Pages\n if (isAppDir) {\n // If this is a prospective render, don't return any metrics or revalidate\n // timings as we aren't persisting this render (it was only to error).\n if (isProspectiveRender) {\n return prospectiveRenderAppPage(\n req,\n res,\n page,\n pathname,\n query,\n fallbackRouteParams,\n renderOpts\n )\n }\n\n return exportAppPage(\n req,\n res,\n page,\n path,\n pathname,\n query,\n fallbackRouteParams,\n renderOpts,\n htmlFilepath,\n debugOutput,\n isDynamicError,\n fileWriter\n )\n }\n\n return exportPagesPage(\n req,\n res,\n path,\n page,\n query,\n params,\n htmlFilepath,\n htmlFilename,\n ampPath,\n subFolders,\n outDir,\n ampValidatorPath,\n pagesDataDir,\n buildExport,\n isDynamic,\n hasOrigQueryValues,\n renderOpts,\n components,\n fileWriter\n )\n}\n\nexport async function exportPages(\n input: ExportPagesInput\n): Promise<ExportPagesResult> {\n const {\n exportPathMap,\n paths,\n dir,\n distDir,\n outDir,\n cacheHandler,\n cacheMaxMemorySize,\n fetchCacheKeyPrefix,\n pagesDataDir,\n renderOpts,\n nextConfig,\n options,\n } = input\n\n // If the fetch cache was enabled, we need to create an incremental\n // cache instance for this page.\n const incrementalCache = await createIncrementalCache({\n cacheHandler,\n cacheMaxMemorySize,\n fetchCacheKeyPrefix,\n distDir,\n dir,\n dynamicIO: Boolean(nextConfig.experimental.dynamicIO),\n // skip writing to disk in minimal mode for now, pending some\n // changes to better support it\n flushToDisk: !hasNextSupport,\n cacheHandlers: nextConfig.experimental.cacheHandlers,\n })\n\n renderOpts.incrementalCache = incrementalCache\n\n const maxConcurrency =\n nextConfig.experimental.staticGenerationMaxConcurrency ?? 8\n const results: ExportPagesResult = []\n\n const exportPageWithRetry = async (path: string, maxAttempts: number) => {\n const pathMap = exportPathMap[path]\n const { page } = exportPathMap[path]\n const pageKey = page !== path ? `${page}: ${path}` : path\n let attempt = 0\n let result\n\n while (attempt < maxAttempts) {\n try {\n result = await Promise.race<ExportPageResult | undefined>([\n exportPage({\n path,\n pathMap,\n distDir,\n outDir,\n pagesDataDir,\n renderOpts,\n ampValidatorPath:\n nextConfig.experimental.amp?.validator || undefined,\n trailingSlash: nextConfig.trailingSlash,\n serverRuntimeConfig: nextConfig.serverRuntimeConfig,\n subFolders: nextConfig.trailingSlash && !options.buildExport,\n buildExport: options.buildExport,\n optimizeCss: nextConfig.experimental.optimizeCss,\n disableOptimizedLoading:\n nextConfig.experimental.disableOptimizedLoading,\n parentSpanId: input.parentSpanId,\n httpAgentOptions: nextConfig.httpAgentOptions,\n debugOutput: options.debugOutput,\n enableExperimentalReact: needsExperimentalReact(nextConfig),\n }),\n // If exporting the page takes longer than the timeout, reject the promise.\n new Promise((_, reject) => {\n setTimeout(() => {\n reject(new TimeoutError())\n }, nextConfig.staticPageGenerationTimeout * 1000)\n }),\n ])\n\n // If there was an error in the export, throw it immediately. In the catch block, we might retry the export,\n // or immediately fail the build, depending on user configuration. We might also continue on and attempt other pages.\n if (result && 'error' in result) {\n throw new ExportPageError()\n }\n\n // If the export succeeds, break out of the retry loop\n break\n } catch (err) {\n // The only error that should be caught here is an ExportError, as `exportPage` doesn't throw and instead returns an object with an `error` property.\n // This is an overly cautious check to ensure that we don't accidentally catch an unexpected error.\n if (!(err instanceof ExportPageError || err instanceof TimeoutError)) {\n throw err\n }\n\n if (err instanceof TimeoutError) {\n // If the export times out, we will restart the worker up to 3 times.\n maxAttempts = 3\n }\n\n // We've reached the maximum number of attempts\n if (attempt >= maxAttempts - 1) {\n // Log a message if we've reached the maximum number of attempts.\n // We only care to do this if maxAttempts was configured.\n if (maxAttempts > 1) {\n console.info(\n `Failed to build ${pageKey} after ${maxAttempts} attempts.`\n )\n }\n // If prerenderEarlyExit is enabled, we'll exit the build immediately.\n if (nextConfig.experimental.prerenderEarlyExit) {\n console.error(\n `Export encountered an error on ${pageKey}, exiting the build.`\n )\n process.exit(1)\n } else {\n // Otherwise, this is a no-op. The build will continue, and a summary of failed pages will be displayed at the end.\n }\n } else {\n // Otherwise, we have more attempts to make. Wait before retrying\n if (err instanceof TimeoutError) {\n console.info(\n `Failed to build ${pageKey} (attempt ${attempt + 1} of ${maxAttempts}) because it took more than ${nextConfig.staticPageGenerationTimeout} seconds. Retrying again shortly.`\n )\n } else {\n console.info(\n `Failed to build ${pageKey} (attempt ${attempt + 1} of ${maxAttempts}). Retrying again shortly.`\n )\n }\n await new Promise((r) => setTimeout(r, Math.random() * 500))\n }\n }\n\n attempt++\n }\n\n return { result, path, pageKey }\n }\n\n for (let i = 0; i < paths.length; i += maxConcurrency) {\n const subset = paths.slice(i, i + maxConcurrency)\n\n const subsetResults = await Promise.all(\n subset.map((path) =>\n exportPageWithRetry(\n path,\n nextConfig.experimental.staticGenerationRetryCount ?? 1\n )\n )\n )\n\n results.push(...subsetResults)\n }\n\n return results\n}\n\nasync function exportPage(\n input: ExportPageInput\n): Promise<ExportPageResult | undefined> {\n trace('export-page', input.parentSpanId).setAttribute('path', input.path)\n\n // Configure the http agent.\n setHttpClientAndAgentOptions({\n httpAgentOptions: input.httpAgentOptions,\n })\n\n const files: ExportedPageFile[] = []\n const baseFileWriter: FileWriter = async (\n type,\n path,\n content,\n encodingOptions = 'utf-8'\n ) => {\n await fs.mkdir(dirname(path), { recursive: true })\n await fs.writeFile(path, content, encodingOptions)\n files.push({ type, path })\n }\n\n const exportPageSpan = trace('export-page-worker', input.parentSpanId)\n\n const start = Date.now()\n\n const turborepoAccessTraceResult = new TurborepoAccessTraceResult()\n\n // Export the page.\n let result: ExportRouteResult | undefined\n try {\n result = await exportPageSpan.traceAsyncFn(() =>\n turborepoTraceAccess(\n () => exportPageImpl(input, baseFileWriter),\n turborepoAccessTraceResult\n )\n )\n\n // If there was no result, then we can exit early.\n if (!result) return\n\n // If there was an error, then we can exit early.\n if ('error' in result) {\n return { error: result.error, duration: Date.now() - start, files: [] }\n }\n } catch (err) {\n console.error(\n `Error occurred prerendering page \"${input.path}\". Read more: https://nextjs.org/docs/messages/prerender-error`\n )\n\n // bailoutToCSRError errors should not leak to the user as they are not actionable; they're\n // a framework signal\n if (!isBailoutToCSRError(err)) {\n // A static generation bailout error is a framework signal to fail static generation but\n // and will encode a reason in the error message. If there is a message, we'll print it.\n // Otherwise there's nothing to show as we don't want to leak an error internal error stack to the user.\n if (isStaticGenBailoutError(err)) {\n if (err.message) {\n console.error(`Error: ${err.message}`)\n }\n } else if (isError(err) && err.stack) {\n console.error(err.stack)\n } else {\n console.error(err)\n }\n }\n\n return { error: true, duration: Date.now() - start, files: [] }\n }\n\n // Notify the parent process that we processed a page (used by the progress activity indicator)\n process.send?.([3, { type: 'activity' }])\n\n // Otherwise we can return the result.\n return {\n duration: Date.now() - start,\n files,\n ampValidations: result.ampValidations,\n revalidate: result.revalidate,\n metadata: result.metadata,\n ssgNotFound: result.ssgNotFound,\n hasEmptyPrelude: result.hasEmptyPrelude,\n hasPostponed: result.hasPostponed,\n turborepoAccessTraceResult: turborepoAccessTraceResult.serialize(),\n fetchMetrics: result.fetchMetrics,\n }\n}\n\nprocess.on('unhandledRejection', (err: unknown) => {\n // if it's a postpone error, it'll be handled later\n // when the postponed promise is actually awaited.\n if (isPostpone(err)) {\n return\n }\n\n // we don't want to log these errors\n if (isDynamicUsageError(err)) {\n return\n }\n\n console.error(err)\n})\n\nprocess.on('rejectionHandled', () => {\n // It is ok to await a Promise late in Next.js as it allows for better\n // prefetching patterns to avoid waterfalls. We ignore logging these.\n // We should've already errored in anyway unhandledRejection.\n})\n\nconst FATAL_UNHANDLED_NEXT_API_EXIT_CODE = 78\n\nprocess.on('uncaughtException', (err) => {\n if (isDynamicUsageError(err)) {\n console.error(\n 'A Next.js API that uses exceptions to signal framework behavior was uncaught. This suggests improper usage of a Next.js API. The original error is printed below and the build will now exit.'\n )\n console.error(err)\n process.exit(FATAL_UNHANDLED_NEXT_API_EXIT_CODE)\n } else {\n console.error(err)\n }\n})\n"],"names":["process","env","NEXT_IS_EXPORT_WORKER","extname","join","dirname","sep","fs","loadComponents","isDynamicRoute","normalizePagePath","normalizeLocalePath","trace","setHttpClientAndAgentOptions","isError","addRequestMeta","normalizeAppPath","createRequestResponseMocks","isAppRouteRoute","hasNextSupport","exportAppRoute","exportAppPage","prospectiveRenderAppPage","exportPagesPage","getParams","createIncrementalCache","isPostpone","isDynamicUsageError","isBailoutToCSRError","turborepoTraceAccess","TurborepoAccessTraceResult","getFallbackRouteParams","needsExperimentalReact","isStaticGenBailoutError","envConfig","require","globalThis","__NEXT_DATA__","nextExport","TimeoutError","Error","code","ExportPageError","exportPageImpl","input","fileWriter","req","path","pathMap","distDir","pagesDataDir","buildExport","serverRuntimeConfig","subFolders","optimizeCss","disableOptimizedLoading","debugOutput","enableExperimentalReact","ampValidatorPath","trailingSlash","__NEXT_EXPERIMENTAL_REACT","page","_fallbackRouteParams","_isAppDir","isAppDir","_isDynamicError","isDynamicError","_isRoutePPREnabled","isRoutePPREnabled","_isProspectiveRender","isProspectiveRender","query","originalQuery","fallbackRouteParams","pathname","isDynamic","outDir","filePath","ampPath","renderAmpPath","updatedPath","__nextSsgPath","locale","__nextLocale","renderOpts","localePathResult","locales","detectedLocale","defaultLocale","hasOrigQueryValues","Object","keys","length","nonLocalizedPath","params","normalizedPage","res","url","statusCode","some","p","endsWith","domainLocales","dl","includes","setConfig","publicRuntimeConfig","runtimeConfig","getHtmlFilename","htmlFilename","pageExt","pathExt","isBuiltinPaths","isHtmlExtPath","baseDir","htmlFilepath","mkdir","recursive","components","isAppPath","routeModule","incrementalCache","cacheLifeProfiles","experimental","buildId","supportsDynamicResponse","isRevalidate","exportPages","exportPathMap","paths","dir","cacheHandler","cacheMaxMemorySize","fetchCacheKeyPrefix","nextConfig","options","dynamicIO","Boolean","flushToDisk","cacheHandlers","maxConcurrency","staticGenerationMaxConcurrency","results","exportPageWithRetry","maxAttempts","pageKey","attempt","result","Promise","race","exportPage","amp","validator","undefined","parentSpanId","httpAgentOptions","_","reject","setTimeout","staticPageGenerationTimeout","err","console","info","prerenderEarlyExit","error","exit","r","Math","random","i","subset","slice","subsetResults","all","map","staticGenerationRetryCount","push","setAttribute","files","baseFileWriter","type","content","encodingOptions","writeFile","exportPageSpan","start","Date","now","turborepoAccessTraceResult","traceAsyncFn","duration","message","stack","send","ampValidations","revalidate","metadata","ssgNotFound","hasEmptyPrelude","hasPostponed","serialize","fetchMetrics","on","FATAL_UNHANDLED_NEXT_API_EXIT_CODE"],"mappings":"AAWA,OAAO,6BAA4B;AAEnCA,QAAQC,GAAG,CAACC,qBAAqB,GAAG;AAEpC,SAASC,OAAO,EAAEC,IAAI,EAAEC,OAAO,EAAEC,GAAG,QAAQ,OAAM;AAClD,OAAOC,QAAQ,cAAa;AAC5B,SAASC,cAAc,QAAQ,4BAA2B;AAC1D,SAASC,cAAc,QAAQ,wCAAuC;AACtE,SAASC,iBAAiB,QAAQ,8CAA6C;AAC/E,SAASC,mBAAmB,QAAQ,2CAA0C;AAC9E,SAASC,KAAK,QAAQ,WAAU;AAChC,SAASC,4BAA4B,QAAQ,iCAAgC;AAC7E,OAAOC,aAAa,kBAAiB;AACrC,SAASC,cAAc,QAAQ,yBAAwB;AACvD,SAASC,gBAAgB,QAAQ,uCAAsC;AAEvE,SAASC,0BAA0B,QAAQ,6BAA4B;AACvE,SAASC,eAAe,QAAQ,4BAA2B;AAC3D,SAASC,cAAc,QAAQ,oBAAmB;AAClD,SAASC,cAAc,QAAQ,qBAAoB;AACnD,SAASC,aAAa,EAAEC,wBAAwB,QAAQ,oBAAmB;AAC3E,SAASC,eAAe,QAAQ,iBAAgB;AAChD,SAASC,SAAS,QAAQ,uBAAsB;AAChD,SAASC,sBAAsB,QAAQ,qCAAoC;AAC3E,SAASC,UAAU,QAAQ,yCAAwC;AACnE,SAASC,mBAAmB,QAAQ,mCAAkC;AACtE,SAASC,mBAAmB,QAAQ,4CAA2C;AAC/E,SACEC,oBAAoB,EACpBC,0BAA0B,QACrB,kCAAiC;AAExC,SACEC,sBAAsB,QAEjB,oCAAmC;AA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,iBAAiBnD,OAAOmD,eAAe;QACvCC,cAAcpD,OAAOoD,YAAY;QACjCX,4BAA4BA,2BAA2BY,SAAS;QAChEC,cAActD,OAAOsD,YAAY;IACnC;AACF;AAEAzM,QAAQ0M,EAAE,CAAC,sBAAsB,CAAC1C;IAChC,mDAAmD;IACnD,kDAAkD;IAClD,IAAItI,WAAWsI,MAAM;QACnB;IACF;IAEA,oCAAoC;IACpC,IAAIrI,oBAAoBqI,MAAM;QAC5B;IACF;IAEAC,QAAQG,KAAK,CAACJ;AAChB;AAEAhK,QAAQ0M,EAAE,CAAC,oBAAoB;AAC7B,sEAAsE;AACtE,qEAAqE;AACrE,6DAA6D;AAC/D;AAEA,MAAMC,qCAAqC;AAE3C3M,QAAQ0M,EAAE,CAAC,qBAAqB,CAAC1C;IAC/B,IAAIrI,oBAAoBqI,MAAM;QAC5BC,QAAQG,KAAK,CACX;QAEFH,QAAQG,KAAK,CAACJ;QACdhK,QAAQqK,IAAI,CAACsC;IACf,OAAO;QACL1C,QAAQG,KAAK,CAACJ;IAChB;AACF"}
|
|
1
|
+
{"version":3,"sources":["../../src/export/worker.ts"],"sourcesContent":["import type {\n ExportPagesInput,\n ExportPageInput,\n ExportPageResult,\n ExportRouteResult,\n ExportedPageFile,\n FileWriter,\n WorkerRenderOpts,\n ExportPagesResult,\n} from './types'\n\nimport '../server/node-environment'\n\nprocess.env.NEXT_IS_EXPORT_WORKER = 'true'\n\nimport { extname, join, dirname, sep } from 'path'\nimport fs from 'fs/promises'\nimport { loadComponents } from '../server/load-components'\nimport { isDynamicRoute } from '../shared/lib/router/utils/is-dynamic'\nimport { normalizePagePath } from '../shared/lib/page-path/normalize-page-path'\nimport { normalizeLocalePath } from '../shared/lib/i18n/normalize-locale-path'\nimport { trace } from '../trace'\nimport { setHttpClientAndAgentOptions } from '../server/setup-http-agent-env'\nimport isError from '../lib/is-error'\nimport { addRequestMeta } from '../server/request-meta'\nimport { normalizeAppPath } from '../shared/lib/router/utils/app-paths'\n\nimport { createRequestResponseMocks } from '../server/lib/mock-request'\nimport { isAppRouteRoute } from '../lib/is-app-route-route'\nimport { hasNextSupport } from '../server/ci-info'\nimport { exportAppRoute } from './routes/app-route'\nimport { exportAppPage, prospectiveRenderAppPage } from './routes/app-page'\nimport { exportPagesPage } from './routes/pages'\nimport { getParams } from './helpers/get-params'\nimport { createIncrementalCache } from './helpers/create-incremental-cache'\nimport { isPostpone } from '../server/lib/router-utils/is-postpone'\nimport { isDynamicUsageError } from './helpers/is-dynamic-usage-error'\nimport { isBailoutToCSRError } from '../shared/lib/lazy-dynamic/bailout-to-csr'\nimport {\n turborepoTraceAccess,\n TurborepoAccessTraceResult,\n} from '../build/turborepo-access-trace'\nimport type { Params } from '../server/request/params'\nimport {\n getFallbackRouteParams,\n type FallbackRouteParams,\n} from '../server/request/fallback-params'\nimport { needsExperimentalReact } from '../lib/needs-experimental-react'\nimport type { AppRouteRouteModule } from '../server/route-modules/app-route/module.compiled'\nimport { isStaticGenBailoutError } from '../client/components/static-generation-bailout'\n\nconst envConfig = require('../shared/lib/runtime-config.external')\n\n;(globalThis as any).__NEXT_DATA__ = {\n nextExport: true,\n}\n\nclass TimeoutError extends Error {\n code = 'NEXT_EXPORT_TIMEOUT_ERROR'\n}\n\nclass ExportPageError extends Error {\n code = 'NEXT_EXPORT_PAGE_ERROR'\n}\n\nasync function exportPageImpl(\n input: ExportPageInput,\n fileWriter: FileWriter\n): Promise<ExportRouteResult | undefined> {\n const {\n path,\n pathMap,\n distDir,\n pagesDataDir,\n buildExport = false,\n serverRuntimeConfig,\n subFolders = false,\n optimizeCss,\n disableOptimizedLoading,\n debugOutput = false,\n enableExperimentalReact,\n ampValidatorPath,\n trailingSlash,\n } = input\n\n if (enableExperimentalReact) {\n process.env.__NEXT_EXPERIMENTAL_REACT = 'true'\n }\n\n const {\n page,\n\n // The parameters that are currently unknown.\n _fallbackRouteParams = [],\n\n // Check if this is an `app/` page.\n _isAppDir: isAppDir = false,\n\n // Check if this should error when dynamic usage is detected.\n _isDynamicError: isDynamicError = false,\n\n // If this page supports partial prerendering, then we need to pass that to\n // the renderOpts.\n _isRoutePPREnabled: isRoutePPREnabled,\n\n // If this is a prospective render, we don't actually want to persist the\n // result, we just want to use it to error the build if there's a problem.\n _isProspectiveRender: isProspectiveRender = false,\n\n // Pull the original query out.\n query: originalQuery = {},\n } = pathMap\n\n const fallbackRouteParams: FallbackRouteParams | null =\n getFallbackRouteParams(_fallbackRouteParams)\n\n let query = { ...originalQuery }\n const pathname = normalizeAppPath(page)\n const isDynamic = isDynamicRoute(page)\n const outDir = isAppDir ? join(distDir, 'server/app') : input.outDir\n\n const filePath = normalizePagePath(path)\n const ampPath = `${filePath}.amp`\n let renderAmpPath = ampPath\n\n let updatedPath = query.__nextSsgPath || path\n delete query.__nextSsgPath\n\n let locale = query.__nextLocale || input.renderOpts.locale\n delete query.__nextLocale\n\n if (input.renderOpts.locale) {\n const localePathResult = normalizeLocalePath(path, input.renderOpts.locales)\n\n if (localePathResult.detectedLocale) {\n updatedPath = localePathResult.pathname\n locale = localePathResult.detectedLocale\n\n if (locale === input.renderOpts.defaultLocale) {\n renderAmpPath = `${normalizePagePath(updatedPath)}.amp`\n }\n }\n }\n\n // We need to show a warning if they try to provide query values\n // for an auto-exported page since they won't be available\n const hasOrigQueryValues = Object.keys(originalQuery).length > 0\n\n // Check if the page is a specified dynamic route\n const { pathname: nonLocalizedPath } = normalizeLocalePath(\n path,\n input.renderOpts.locales\n )\n\n let params: Params | undefined\n\n if (isDynamic && page !== nonLocalizedPath) {\n const normalizedPage = isAppDir ? normalizeAppPath(page) : page\n\n params = getParams(normalizedPage, updatedPath)\n }\n\n const { req, res } = createRequestResponseMocks({ url: updatedPath })\n\n // If this is a status code page, then set the response code.\n for (const statusCode of [404, 500]) {\n if (\n [\n `/${statusCode}`,\n `/${statusCode}.html`,\n `/${statusCode}/index.html`,\n ].some((p) => p === updatedPath || `/${locale}${p}` === updatedPath)\n ) {\n res.statusCode = statusCode\n }\n }\n\n // Ensure that the URL has a trailing slash if it's configured.\n if (trailingSlash && !req.url?.endsWith('/')) {\n req.url += '/'\n }\n\n if (\n locale &&\n buildExport &&\n input.renderOpts.domainLocales &&\n input.renderOpts.domainLocales.some(\n (dl) => dl.defaultLocale === locale || dl.locales?.includes(locale || '')\n )\n ) {\n addRequestMeta(req, 'isLocaleDomain', true)\n }\n\n envConfig.setConfig({\n serverRuntimeConfig,\n publicRuntimeConfig: input.renderOpts.runtimeConfig,\n })\n\n const getHtmlFilename = (p: string) =>\n subFolders ? `${p}${sep}index.html` : `${p}.html`\n\n let htmlFilename = getHtmlFilename(filePath)\n\n // dynamic routes can provide invalid extensions e.g. /blog/[...slug] returns an\n // extension of `.slug]`\n const pageExt = isDynamic || isAppDir ? '' : extname(page)\n const pathExt = isDynamic || isAppDir ? '' : extname(path)\n\n // force output 404.html for backwards compat\n if (path === '/404.html') {\n htmlFilename = path\n }\n // Make sure page isn't a folder with a dot in the name e.g. `v1.2`\n else if (pageExt !== pathExt && pathExt !== '') {\n const isBuiltinPaths = ['/500', '/404'].some(\n (p) => p === path || p === path + '.html'\n )\n // If the ssg path has .html extension, and it's not builtin paths, use it directly\n // Otherwise, use that as the filename instead\n const isHtmlExtPath = !isBuiltinPaths && path.endsWith('.html')\n htmlFilename = isHtmlExtPath ? getHtmlFilename(path) : path\n } else if (path === '/') {\n // If the path is the root, just use index.html\n htmlFilename = 'index.html'\n }\n\n const baseDir = join(outDir, dirname(htmlFilename))\n let htmlFilepath = join(outDir, htmlFilename)\n\n await fs.mkdir(baseDir, { recursive: true })\n\n const components = await loadComponents({\n distDir,\n page,\n isAppPath: isAppDir,\n isDev: false,\n })\n\n // Handle App Routes.\n if (isAppDir && isAppRouteRoute(page)) {\n return exportAppRoute(\n req,\n res,\n params,\n page,\n components.routeModule as AppRouteRouteModule,\n input.renderOpts.incrementalCache,\n input.renderOpts.cacheLifeProfiles,\n htmlFilepath,\n fileWriter,\n input.renderOpts.experimental,\n input.renderOpts.buildId\n )\n }\n\n const renderOpts: WorkerRenderOpts = {\n ...components,\n ...input.renderOpts,\n ampPath: renderAmpPath,\n params,\n optimizeCss,\n disableOptimizedLoading,\n locale,\n supportsDynamicResponse: false,\n experimental: {\n ...input.renderOpts.experimental,\n isRoutePPREnabled,\n },\n }\n\n if (hasNextSupport) {\n renderOpts.isRevalidate = true\n }\n\n // Handle App Pages\n if (isAppDir) {\n // If this is a prospective render, don't return any metrics or revalidate\n // timings as we aren't persisting this render (it was only to error).\n if (isProspectiveRender) {\n return prospectiveRenderAppPage(\n req,\n res,\n page,\n pathname,\n query,\n fallbackRouteParams,\n renderOpts\n )\n }\n\n return exportAppPage(\n req,\n res,\n page,\n path,\n pathname,\n query,\n fallbackRouteParams,\n renderOpts,\n htmlFilepath,\n debugOutput,\n isDynamicError,\n fileWriter\n )\n }\n\n return exportPagesPage(\n req,\n res,\n path,\n page,\n query,\n params,\n htmlFilepath,\n htmlFilename,\n ampPath,\n subFolders,\n outDir,\n ampValidatorPath,\n pagesDataDir,\n buildExport,\n isDynamic,\n hasOrigQueryValues,\n renderOpts,\n components,\n fileWriter\n )\n}\n\nexport async function exportPages(\n input: ExportPagesInput\n): Promise<ExportPagesResult> {\n const {\n exportPathMap,\n paths,\n dir,\n distDir,\n outDir,\n cacheHandler,\n cacheMaxMemorySize,\n fetchCacheKeyPrefix,\n pagesDataDir,\n renderOpts,\n nextConfig,\n options,\n } = input\n\n // If the fetch cache was enabled, we need to create an incremental\n // cache instance for this page.\n const incrementalCache = await createIncrementalCache({\n cacheHandler,\n cacheMaxMemorySize,\n fetchCacheKeyPrefix,\n distDir,\n dir,\n dynamicIO: Boolean(nextConfig.experimental.dynamicIO),\n // skip writing to disk in minimal mode for now, pending some\n // changes to better support it\n flushToDisk: !hasNextSupport,\n cacheHandlers: nextConfig.experimental.cacheHandlers,\n })\n\n renderOpts.incrementalCache = incrementalCache\n\n const maxConcurrency =\n nextConfig.experimental.staticGenerationMaxConcurrency ?? 8\n const results: ExportPagesResult = []\n\n const exportPageWithRetry = async (path: string, maxAttempts: number) => {\n const pathMap = exportPathMap[path]\n const { page } = exportPathMap[path]\n const pageKey = page !== path ? `${page}: ${path}` : path\n let attempt = 0\n let result\n\n while (attempt < maxAttempts) {\n try {\n result = await Promise.race<ExportPageResult | undefined>([\n exportPage({\n path,\n pathMap,\n distDir,\n outDir,\n pagesDataDir,\n renderOpts,\n ampValidatorPath:\n nextConfig.experimental.amp?.validator || undefined,\n trailingSlash: nextConfig.trailingSlash,\n serverRuntimeConfig: nextConfig.serverRuntimeConfig,\n subFolders: nextConfig.trailingSlash && !options.buildExport,\n buildExport: options.buildExport,\n optimizeCss: nextConfig.experimental.optimizeCss,\n disableOptimizedLoading:\n nextConfig.experimental.disableOptimizedLoading,\n parentSpanId: input.parentSpanId,\n httpAgentOptions: nextConfig.httpAgentOptions,\n debugOutput: options.debugOutput,\n enableExperimentalReact: needsExperimentalReact(nextConfig),\n }),\n // If exporting the page takes longer than the timeout, reject the promise.\n new Promise((_, reject) => {\n setTimeout(() => {\n reject(new TimeoutError())\n }, nextConfig.staticPageGenerationTimeout * 1000)\n }),\n ])\n\n // If there was an error in the export, throw it immediately. In the catch block, we might retry the export,\n // or immediately fail the build, depending on user configuration. We might also continue on and attempt other pages.\n if (result && 'error' in result) {\n throw new ExportPageError()\n }\n\n // If the export succeeds, break out of the retry loop\n break\n } catch (err) {\n // The only error that should be caught here is an ExportError, as `exportPage` doesn't throw and instead returns an object with an `error` property.\n // This is an overly cautious check to ensure that we don't accidentally catch an unexpected error.\n if (!(err instanceof ExportPageError || err instanceof TimeoutError)) {\n throw err\n }\n\n if (err instanceof TimeoutError) {\n // If the export times out, we will restart the worker up to 3 times.\n maxAttempts = 3\n }\n\n // We've reached the maximum number of attempts\n if (attempt >= maxAttempts - 1) {\n // Log a message if we've reached the maximum number of attempts.\n // We only care to do this if maxAttempts was configured.\n if (maxAttempts > 1) {\n console.info(\n `Failed to build ${pageKey} after ${maxAttempts} attempts.`\n )\n }\n // If prerenderEarlyExit is enabled, we'll exit the build immediately.\n if (nextConfig.experimental.prerenderEarlyExit) {\n console.error(\n `Export encountered an error on ${pageKey}, exiting the build.`\n )\n process.exit(1)\n } else {\n // Otherwise, this is a no-op. The build will continue, and a summary of failed pages will be displayed at the end.\n }\n } else {\n // Otherwise, we have more attempts to make. Wait before retrying\n if (err instanceof TimeoutError) {\n console.info(\n `Failed to build ${pageKey} (attempt ${attempt + 1} of ${maxAttempts}) because it took more than ${nextConfig.staticPageGenerationTimeout} seconds. Retrying again shortly.`\n )\n } else {\n console.info(\n `Failed to build ${pageKey} (attempt ${attempt + 1} of ${maxAttempts}). Retrying again shortly.`\n )\n }\n await new Promise((r) => setTimeout(r, Math.random() * 500))\n }\n }\n\n attempt++\n }\n\n return { result, path, pageKey }\n }\n\n for (let i = 0; i < paths.length; i += maxConcurrency) {\n const subset = paths.slice(i, i + maxConcurrency)\n\n const subsetResults = await Promise.all(\n subset.map((path) =>\n exportPageWithRetry(\n path,\n nextConfig.experimental.staticGenerationRetryCount ?? 1\n )\n )\n )\n\n results.push(...subsetResults)\n }\n\n return results\n}\n\nasync function exportPage(\n input: ExportPageInput\n): Promise<ExportPageResult | undefined> {\n trace('export-page', input.parentSpanId).setAttribute('path', input.path)\n\n // Configure the http agent.\n setHttpClientAndAgentOptions({\n httpAgentOptions: input.httpAgentOptions,\n })\n\n const files: ExportedPageFile[] = []\n const baseFileWriter: FileWriter = async (\n type,\n path,\n content,\n encodingOptions = 'utf-8'\n ) => {\n await fs.mkdir(dirname(path), { recursive: true })\n await fs.writeFile(path, content, encodingOptions)\n files.push({ type, path })\n }\n\n const exportPageSpan = trace('export-page-worker', input.parentSpanId)\n\n const start = Date.now()\n\n const turborepoAccessTraceResult = new TurborepoAccessTraceResult()\n\n // Export the page.\n let result: ExportRouteResult | undefined\n try {\n result = await exportPageSpan.traceAsyncFn(() =>\n turborepoTraceAccess(\n () => exportPageImpl(input, baseFileWriter),\n turborepoAccessTraceResult\n )\n )\n\n // If there was no result, then we can exit early.\n if (!result) return\n\n // If there was an error, then we can exit early.\n if ('error' in result) {\n return { error: result.error, duration: Date.now() - start, files: [] }\n }\n } catch (err) {\n console.error(\n `Error occurred prerendering page \"${input.path}\". Read more: https://nextjs.org/docs/messages/prerender-error`\n )\n\n // bailoutToCSRError errors should not leak to the user as they are not actionable; they're\n // a framework signal\n if (!isBailoutToCSRError(err)) {\n // A static generation bailout error is a framework signal to fail static generation but\n // and will encode a reason in the error message. If there is a message, we'll print it.\n // Otherwise there's nothing to show as we don't want to leak an error internal error stack to the user.\n if (isStaticGenBailoutError(err)) {\n if (err.message) {\n console.error(`Error: ${err.message}`)\n }\n } else if (isError(err) && err.stack) {\n console.error(err.stack)\n } else {\n console.error(err)\n }\n }\n\n return { error: true, duration: Date.now() - start, files: [] }\n }\n\n // Notify the parent process that we processed a page (used by the progress activity indicator)\n process.send?.([3, { type: 'activity' }])\n\n // Otherwise we can return the result.\n return {\n duration: Date.now() - start,\n files,\n ampValidations: result.ampValidations,\n revalidate: result.revalidate,\n metadata: result.metadata,\n ssgNotFound: result.ssgNotFound,\n hasEmptyPrelude: result.hasEmptyPrelude,\n hasPostponed: result.hasPostponed,\n turborepoAccessTraceResult: turborepoAccessTraceResult.serialize(),\n fetchMetrics: result.fetchMetrics,\n }\n}\n\nprocess.on('unhandledRejection', (err: unknown) => {\n // if it's a postpone error, it'll be handled later\n // when the postponed promise is actually awaited.\n if (isPostpone(err)) {\n return\n }\n\n // we don't want to log these errors\n if (isDynamicUsageError(err)) {\n return\n }\n\n console.error(err)\n})\n\nprocess.on('rejectionHandled', () => {\n // It is ok to await a Promise late in Next.js as it allows for better\n // prefetching patterns to avoid waterfalls. We ignore logging these.\n // We should've already errored in anyway unhandledRejection.\n})\n\nconst FATAL_UNHANDLED_NEXT_API_EXIT_CODE = 78\n\nprocess.on('uncaughtException', (err) => {\n if (isDynamicUsageError(err)) {\n console.error(\n 'A Next.js API that uses exceptions to signal framework behavior was uncaught. This suggests improper usage of a Next.js API. The original error is printed below and the build will now exit.'\n )\n console.error(err)\n process.exit(FATAL_UNHANDLED_NEXT_API_EXIT_CODE)\n } else {\n console.error(err)\n }\n})\n"],"names":["process","env","NEXT_IS_EXPORT_WORKER","extname","join","dirname","sep","fs","loadComponents","isDynamicRoute","normalizePagePath","normalizeLocalePath","trace","setHttpClientAndAgentOptions","isError","addRequestMeta","normalizeAppPath","createRequestResponseMocks","isAppRouteRoute","hasNextSupport","exportAppRoute","exportAppPage","prospectiveRenderAppPage","exportPagesPage","getParams","createIncrementalCache","isPostpone","isDynamicUsageError","isBailoutToCSRError","turborepoTraceAccess","TurborepoAccessTraceResult","getFallbackRouteParams","needsExperimentalReact","isStaticGenBailoutError","envConfig","require","globalThis","__NEXT_DATA__","nextExport","TimeoutError","Error","code","ExportPageError","exportPageImpl","input","fileWriter","req","path","pathMap","distDir","pagesDataDir","buildExport","serverRuntimeConfig","subFolders","optimizeCss","disableOptimizedLoading","debugOutput","enableExperimentalReact","ampValidatorPath","trailingSlash","__NEXT_EXPERIMENTAL_REACT","page","_fallbackRouteParams","_isAppDir","isAppDir","_isDynamicError","isDynamicError","_isRoutePPREnabled","isRoutePPREnabled","_isProspectiveRender","isProspectiveRender","query","originalQuery","fallbackRouteParams","pathname","isDynamic","outDir","filePath","ampPath","renderAmpPath","updatedPath","__nextSsgPath","locale","__nextLocale","renderOpts","localePathResult","locales","detectedLocale","defaultLocale","hasOrigQueryValues","Object","keys","length","nonLocalizedPath","params","normalizedPage","res","url","statusCode","some","p","endsWith","domainLocales","dl","includes","setConfig","publicRuntimeConfig","runtimeConfig","getHtmlFilename","htmlFilename","pageExt","pathExt","isBuiltinPaths","isHtmlExtPath","baseDir","htmlFilepath","mkdir","recursive","components","isAppPath","isDev","routeModule","incrementalCache","cacheLifeProfiles","experimental","buildId","supportsDynamicResponse","isRevalidate","exportPages","exportPathMap","paths","dir","cacheHandler","cacheMaxMemorySize","fetchCacheKeyPrefix","nextConfig","options","dynamicIO","Boolean","flushToDisk","cacheHandlers","maxConcurrency","staticGenerationMaxConcurrency","results","exportPageWithRetry","maxAttempts","pageKey","attempt","result","Promise","race","exportPage","amp","validator","undefined","parentSpanId","httpAgentOptions","_","reject","setTimeout","staticPageGenerationTimeout","err","console","info","prerenderEarlyExit","error","exit","r","Math","random","i","subset","slice","subsetResults","all","map","staticGenerationRetryCount","push","setAttribute","files","baseFileWriter","type","content","encodingOptions","writeFile","exportPageSpan","start","Date","now","turborepoAccessTraceResult","traceAsyncFn","duration","message","stack","send","ampValidations","revalidate","metadata","ssgNotFound","hasEmptyPrelude","hasPostponed","serialize","fetchMetrics","on","FATAL_UNHANDLED_NEXT_API_EXIT_CODE"],"mappings":"AAWA,OAAO,6BAA4B;AAEnCA,QAAQC,GAAG,CAACC,qBAAqB,GAAG;AAEpC,SAASC,OAAO,EAAEC,IAAI,EAAEC,OAAO,EAAEC,GAAG,QAAQ,OAAM;AAClD,OAAOC,QAAQ,cAAa;AAC5B,SAASC,cAAc,QAAQ,4BAA2B;AAC1D,SAASC,cAAc,QAAQ,wCAAuC;AACtE,SAASC,iBAAiB,QAAQ,8CAA6C;AAC/E,SAASC,mBAAmB,QAAQ,2CAA0C;AAC9E,SAASC,KAAK,QAAQ,WAAU;AAChC,SAASC,4BAA4B,QAAQ,iCAAgC;AAC7E,OAAOC,aAAa,kBAAiB;AACrC,SAASC,cAAc,QAAQ,yBAAwB;AACvD,SAASC,gBAAgB,QAAQ,uCAAsC;AAEvE,SAASC,0BAA0B,QAAQ,6BAA4B;AACvE,SAASC,eAAe,QAAQ,4BAA2B;AAC3D,SAASC,cAAc,QAAQ,oBAAmB;AAClD,SAASC,cAAc,QAAQ,qBAAoB;AACnD,SAASC,aAAa,EAAEC,wBAAwB,QAAQ,oBAAmB;AAC3E,SAASC,eAAe,QAAQ,iBAAgB;AAChD,SAASC,SAAS,QAAQ,uBAAsB;AAChD,SAASC,sBAAsB,QAAQ,qCAAoC;AAC3E,SAASC,UAAU,QAAQ,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AsC;IACtC,OAAO;QACLU,UAAUJ,KAAKC,GAAG,KAAKF;QACvBP;QACAgB,gBAAgB/C,OAAO+C,cAAc;QACrCC,YAAYhD,OAAOgD,UAAU;QAC7BC,UAAUjD,OAAOiD,QAAQ;QACzBC,aAAalD,OAAOkD,WAAW;QAC/BC,iBAAiBnD,OAAOmD,eAAe;QACvCC,cAAcpD,OAAOoD,YAAY;QACjCX,4BAA4BA,2BAA2BY,SAAS;QAChEC,cAActD,OAAOsD,YAAY;IACnC;AACF;AAEA1M,QAAQ2M,EAAE,CAAC,sBAAsB,CAAC1C;IAChC,mDAAmD;IACnD,kDAAkD;IAClD,IAAIvI,WAAWuI,MAAM;QACnB;IACF;IAEA,oCAAoC;IACpC,IAAItI,oBAAoBsI,MAAM;QAC5B;IACF;IAEAC,QAAQG,KAAK,CAACJ;AAChB;AAEAjK,QAAQ2M,EAAE,CAAC,oBAAoB;AAC7B,sEAAsE;AACtE,qEAAqE;AACrE,6DAA6D;AAC/D;AAEA,MAAMC,qCAAqC;AAE3C5M,QAAQ2M,EAAE,CAAC,qBAAqB,CAAC1C;IAC/B,IAAItI,oBAAoBsI,MAAM;QAC5BC,QAAQG,KAAK,CACX;QAEFH,QAAQG,KAAK,CAACJ;QACdjK,QAAQsK,IAAI,CAACsC;IACf,OAAO;QACL1C,QAAQG,KAAK,CAACJ;IAChB;AACF"}
|
|
@@ -176,7 +176,7 @@ function assignDefaults(dir, userConfig, silent) {
|
|
|
176
176
|
enumerable: false
|
|
177
177
|
});
|
|
178
178
|
}
|
|
179
|
-
if (!((_process_env___NEXT_VERSION = "15.1.1-canary.
|
|
179
|
+
if (!((_process_env___NEXT_VERSION = "15.1.1-canary.5") == null ? void 0 : _process_env___NEXT_VERSION.includes('canary')) && !process.env.__NEXT_TEST_MODE && !process.env.NEXT_PRIVATE_SKIP_CANARY_CHECK) {
|
|
180
180
|
var _result_experimental7, _result_experimental8, _result_experimental_turbo3, _result_experimental9;
|
|
181
181
|
// Prevents usage of certain experimental features outside of canary
|
|
182
182
|
if ((_result_experimental7 = result.experimental) == null ? void 0 : _result_experimental7.ppr) {
|
|
@@ -78,7 +78,7 @@ export async function createHotReloaderTurbopack(opts, serverFields, distDir, re
|
|
|
78
78
|
}
|
|
79
79
|
const hasRewrites = opts.fsChecker.rewrites.afterFiles.length > 0 || opts.fsChecker.rewrites.beforeFiles.length > 0 || opts.fsChecker.rewrites.fallback.length > 0;
|
|
80
80
|
const hotReloaderSpan = trace('hot-reloader', undefined, {
|
|
81
|
-
version: "15.1.1-canary.
|
|
81
|
+
version: "15.1.1-canary.5"
|
|
82
82
|
});
|
|
83
83
|
// Ensure the hotReloaderSpan is flushed immediately as it's the parentSpan for all processing
|
|
84
84
|
// of the current `next dev` invocation.
|
|
@@ -184,7 +184,7 @@ export default class HotReloaderWebpack {
|
|
|
184
184
|
this.previewProps = previewProps;
|
|
185
185
|
this.rewrites = rewrites;
|
|
186
186
|
this.hotReloaderSpan = trace('hot-reloader', undefined, {
|
|
187
|
-
version: "15.1.1-canary.
|
|
187
|
+
version: "15.1.1-canary.5"
|
|
188
188
|
});
|
|
189
189
|
// Ensure the hotReloaderSpan is flushed immediately as it's the parentSpan for all processing
|
|
190
190
|
// of the current `next dev` invocation.
|
|
@@ -20,7 +20,8 @@ export async function loadStaticPaths({ dir, distDir, pathname, config, httpAgen
|
|
|
20
20
|
distDir,
|
|
21
21
|
// In `pages/`, the page is the same as the pathname.
|
|
22
22
|
page: page || pathname,
|
|
23
|
-
isAppPath
|
|
23
|
+
isAppPath,
|
|
24
|
+
isDev: true
|
|
24
25
|
});
|
|
25
26
|
if (isAppPath) {
|
|
26
27
|
const segments = await collectSegments(components);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/server/dev/static-paths-worker.ts"],"sourcesContent":["import type { NextConfigComplete } from '../config-shared'\n\nimport '../require-hook'\nimport '../node-environment'\n\nimport {\n buildAppStaticPaths,\n buildStaticPaths,\n reduceAppConfig,\n} from '../../build/utils'\nimport { collectSegments } from '../../build/segment-config/app/app-segments'\nimport type { PartialStaticPathsResult } from '../../build/utils'\nimport { loadComponents } from '../load-components'\nimport { setHttpClientAndAgentOptions } from '../setup-http-agent-env'\nimport type { IncrementalCache } from '../lib/incremental-cache'\nimport { isAppPageRouteModule } from '../route-modules/checks'\nimport {\n checkIsRoutePPREnabled,\n type ExperimentalPPRConfig,\n} from '../lib/experimental/ppr'\nimport { InvariantError } from '../../shared/lib/invariant-error'\n\ntype RuntimeConfig = {\n pprConfig: ExperimentalPPRConfig | undefined\n configFileName: string\n publicRuntimeConfig: { [key: string]: any }\n serverRuntimeConfig: { [key: string]: any }\n dynamicIO: boolean\n}\n\n// we call getStaticPaths in a separate process to ensure\n// side-effects aren't relied on in dev that will break\n// during a production build\nexport async function loadStaticPaths({\n dir,\n distDir,\n pathname,\n config,\n httpAgentOptions,\n locales,\n defaultLocale,\n isAppPath,\n page,\n isrFlushToDisk,\n fetchCacheKeyPrefix,\n maxMemoryCacheSize,\n requestHeaders,\n cacheHandler,\n cacheLifeProfiles,\n nextConfigOutput,\n buildId,\n authInterrupts,\n}: {\n dir: string\n distDir: string\n pathname: string\n config: RuntimeConfig\n httpAgentOptions: NextConfigComplete['httpAgentOptions']\n locales?: string[]\n defaultLocale?: string\n isAppPath: boolean\n page: string\n isrFlushToDisk?: boolean\n fetchCacheKeyPrefix?: string\n maxMemoryCacheSize?: number\n requestHeaders: IncrementalCache['requestHeaders']\n cacheHandler?: string\n cacheLifeProfiles?: {\n [profile: string]: import('../../server/use-cache/cache-life').CacheLife\n }\n nextConfigOutput: 'standalone' | 'export' | undefined\n buildId: string\n authInterrupts: boolean\n}): Promise<PartialStaticPathsResult> {\n // update work memory runtime-config\n require('../../shared/lib/runtime-config.external').setConfig(config)\n setHttpClientAndAgentOptions({\n httpAgentOptions,\n })\n\n const components = await loadComponents({\n distDir,\n // In `pages/`, the page is the same as the pathname.\n page: page || pathname,\n isAppPath,\n })\n\n if (isAppPath) {\n const segments = await collectSegments(components)\n\n const isRoutePPREnabled =\n isAppPageRouteModule(components.routeModule) &&\n checkIsRoutePPREnabled(config.pprConfig, reduceAppConfig(segments))\n\n return buildAppStaticPaths({\n dir,\n page: pathname,\n dynamicIO: config.dynamicIO,\n segments,\n configFileName: config.configFileName,\n distDir,\n requestHeaders,\n cacheHandler,\n cacheLifeProfiles,\n isrFlushToDisk,\n fetchCacheKeyPrefix,\n maxMemoryCacheSize,\n ComponentMod: components.ComponentMod,\n nextConfigOutput,\n isRoutePPREnabled,\n buildId,\n authInterrupts,\n })\n } else if (!components.getStaticPaths) {\n // We shouldn't get to this point since the worker should only be called for\n // SSG pages with getStaticPaths.\n throw new InvariantError(\n `Failed to load page with getStaticPaths for ${pathname}`\n )\n }\n\n return buildStaticPaths({\n page: pathname,\n getStaticPaths: components.getStaticPaths,\n configFileName: config.configFileName,\n locales,\n defaultLocale,\n })\n}\n"],"names":["buildAppStaticPaths","buildStaticPaths","reduceAppConfig","collectSegments","loadComponents","setHttpClientAndAgentOptions","isAppPageRouteModule","checkIsRoutePPREnabled","InvariantError","loadStaticPaths","dir","distDir","pathname","config","httpAgentOptions","locales","defaultLocale","isAppPath","page","isrFlushToDisk","fetchCacheKeyPrefix","maxMemoryCacheSize","requestHeaders","cacheHandler","cacheLifeProfiles","nextConfigOutput","buildId","authInterrupts","require","setConfig","components","segments","isRoutePPREnabled","routeModule","pprConfig","dynamicIO","configFileName","ComponentMod","getStaticPaths"],"mappings":"AAEA,OAAO,kBAAiB;AACxB,OAAO,sBAAqB;AAE5B,SACEA,mBAAmB,EACnBC,gBAAgB,EAChBC,eAAe,QACV,oBAAmB;AAC1B,SAASC,eAAe,QAAQ,8CAA6C;AAE7E,SAASC,cAAc,QAAQ,qBAAoB;AACnD,SAASC,4BAA4B,QAAQ,0BAAyB;AAEtE,SAASC,oBAAoB,QAAQ,0BAAyB;AAC9D,SACEC,sBAAsB,QAEjB,0BAAyB;AAChC,SAASC,cAAc,QAAQ,mCAAkC;AAUjE,yDAAyD;AACzD,uDAAuD;AACvD,4BAA4B;AAC5B,OAAO,eAAeC,gBAAgB,EACpCC,GAAG,EACHC,OAAO,EACPC,QAAQ,EACRC,MAAM,EACNC,gBAAgB,EAChBC,OAAO,EACPC,aAAa,EACbC,SAAS,EACTC,IAAI,EACJC,cAAc,EACdC,mBAAmB,EACnBC,kBAAkB,EAClBC,cAAc,EACdC,YAAY,EACZC,iBAAiB,EACjBC,gBAAgB,EAChBC,OAAO,EACPC,cAAc,EAsBf;IACC,oCAAoC;IACpCC,QAAQ,4CAA4CC,SAAS,CAAChB;IAC9DR,6BAA6B;QAC3BS;IACF;IAEA,MAAMgB,aAAa,MAAM1B,eAAe;QACtCO;QACA,qDAAqD;QACrDO,MAAMA,QAAQN;QACdK;
|
|
1
|
+
{"version":3,"sources":["../../../src/server/dev/static-paths-worker.ts"],"sourcesContent":["import type { NextConfigComplete } from '../config-shared'\n\nimport '../require-hook'\nimport '../node-environment'\n\nimport {\n buildAppStaticPaths,\n buildStaticPaths,\n reduceAppConfig,\n} from '../../build/utils'\nimport { collectSegments } from '../../build/segment-config/app/app-segments'\nimport type { PartialStaticPathsResult } from '../../build/utils'\nimport { loadComponents } from '../load-components'\nimport { setHttpClientAndAgentOptions } from '../setup-http-agent-env'\nimport type { IncrementalCache } from '../lib/incremental-cache'\nimport { isAppPageRouteModule } from '../route-modules/checks'\nimport {\n checkIsRoutePPREnabled,\n type ExperimentalPPRConfig,\n} from '../lib/experimental/ppr'\nimport { InvariantError } from '../../shared/lib/invariant-error'\n\ntype RuntimeConfig = {\n pprConfig: ExperimentalPPRConfig | undefined\n configFileName: string\n publicRuntimeConfig: { [key: string]: any }\n serverRuntimeConfig: { [key: string]: any }\n dynamicIO: boolean\n}\n\n// we call getStaticPaths in a separate process to ensure\n// side-effects aren't relied on in dev that will break\n// during a production build\nexport async function loadStaticPaths({\n dir,\n distDir,\n pathname,\n config,\n httpAgentOptions,\n locales,\n defaultLocale,\n isAppPath,\n page,\n isrFlushToDisk,\n fetchCacheKeyPrefix,\n maxMemoryCacheSize,\n requestHeaders,\n cacheHandler,\n cacheLifeProfiles,\n nextConfigOutput,\n buildId,\n authInterrupts,\n}: {\n dir: string\n distDir: string\n pathname: string\n config: RuntimeConfig\n httpAgentOptions: NextConfigComplete['httpAgentOptions']\n locales?: string[]\n defaultLocale?: string\n isAppPath: boolean\n page: string\n isrFlushToDisk?: boolean\n fetchCacheKeyPrefix?: string\n maxMemoryCacheSize?: number\n requestHeaders: IncrementalCache['requestHeaders']\n cacheHandler?: string\n cacheLifeProfiles?: {\n [profile: string]: import('../../server/use-cache/cache-life').CacheLife\n }\n nextConfigOutput: 'standalone' | 'export' | undefined\n buildId: string\n authInterrupts: boolean\n}): Promise<PartialStaticPathsResult> {\n // update work memory runtime-config\n require('../../shared/lib/runtime-config.external').setConfig(config)\n setHttpClientAndAgentOptions({\n httpAgentOptions,\n })\n\n const components = await loadComponents({\n distDir,\n // In `pages/`, the page is the same as the pathname.\n page: page || pathname,\n isAppPath,\n isDev: true,\n })\n\n if (isAppPath) {\n const segments = await collectSegments(components)\n\n const isRoutePPREnabled =\n isAppPageRouteModule(components.routeModule) &&\n checkIsRoutePPREnabled(config.pprConfig, reduceAppConfig(segments))\n\n return buildAppStaticPaths({\n dir,\n page: pathname,\n dynamicIO: config.dynamicIO,\n segments,\n configFileName: config.configFileName,\n distDir,\n requestHeaders,\n cacheHandler,\n cacheLifeProfiles,\n isrFlushToDisk,\n fetchCacheKeyPrefix,\n maxMemoryCacheSize,\n ComponentMod: components.ComponentMod,\n nextConfigOutput,\n isRoutePPREnabled,\n buildId,\n authInterrupts,\n })\n } else if (!components.getStaticPaths) {\n // We shouldn't get to this point since the worker should only be called for\n // SSG pages with getStaticPaths.\n throw new InvariantError(\n `Failed to load page with getStaticPaths for ${pathname}`\n )\n }\n\n return buildStaticPaths({\n page: pathname,\n getStaticPaths: components.getStaticPaths,\n configFileName: config.configFileName,\n locales,\n defaultLocale,\n })\n}\n"],"names":["buildAppStaticPaths","buildStaticPaths","reduceAppConfig","collectSegments","loadComponents","setHttpClientAndAgentOptions","isAppPageRouteModule","checkIsRoutePPREnabled","InvariantError","loadStaticPaths","dir","distDir","pathname","config","httpAgentOptions","locales","defaultLocale","isAppPath","page","isrFlushToDisk","fetchCacheKeyPrefix","maxMemoryCacheSize","requestHeaders","cacheHandler","cacheLifeProfiles","nextConfigOutput","buildId","authInterrupts","require","setConfig","components","isDev","segments","isRoutePPREnabled","routeModule","pprConfig","dynamicIO","configFileName","ComponentMod","getStaticPaths"],"mappings":"AAEA,OAAO,kBAAiB;AACxB,OAAO,sBAAqB;AAE5B,SACEA,mBAAmB,EACnBC,gBAAgB,EAChBC,eAAe,QACV,oBAAmB;AAC1B,SAASC,eAAe,QAAQ,8CAA6C;AAE7E,SAASC,cAAc,QAAQ,qBAAoB;AACnD,SAASC,4BAA4B,QAAQ,0BAAyB;AAEtE,SAASC,oBAAoB,QAAQ,0BAAyB;AAC9D,SACEC,sBAAsB,QAEjB,0BAAyB;AAChC,SAASC,cAAc,QAAQ,mCAAkC;AAUjE,yDAAyD;AACzD,uDAAuD;AACvD,4BAA4B;AAC5B,OAAO,eAAeC,gBAAgB,EACpCC,GAAG,EACHC,OAAO,EACPC,QAAQ,EACRC,MAAM,EACNC,gBAAgB,EAChBC,OAAO,EACPC,aAAa,EACbC,SAAS,EACTC,IAAI,EACJC,cAAc,EACdC,mBAAmB,EACnBC,kBAAkB,EAClBC,cAAc,EACdC,YAAY,EACZC,iBAAiB,EACjBC,gBAAgB,EAChBC,OAAO,EACPC,cAAc,EAsBf;IACC,oCAAoC;IACpCC,QAAQ,4CAA4CC,SAAS,CAAChB;IAC9DR,6BAA6B;QAC3BS;IACF;IAEA,MAAMgB,aAAa,MAAM1B,eAAe;QACtCO;QACA,qDAAqD;QACrDO,MAAMA,QAAQN;QACdK;QACAc,OAAO;IACT;IAEA,IAAId,WAAW;QACb,MAAMe,WAAW,MAAM7B,gBAAgB2B;QAEvC,MAAMG,oBACJ3B,qBAAqBwB,WAAWI,WAAW,KAC3C3B,uBAAuBM,OAAOsB,SAAS,EAAEjC,gBAAgB8B;QAE3D,OAAOhC,oBAAoB;YACzBU;YACAQ,MAAMN;YACNwB,WAAWvB,OAAOuB,SAAS;YAC3BJ;YACAK,gBAAgBxB,OAAOwB,cAAc;YACrC1B;YACAW;YACAC;YACAC;YACAL;YACAC;YACAC;YACAiB,cAAcR,WAAWQ,YAAY;YACrCb;YACAQ;YACAP;YACAC;QACF;IACF,OAAO,IAAI,CAACG,WAAWS,cAAc,EAAE;QACrC,4EAA4E;QAC5E,iCAAiC;QACjC,MAAM,qBAEL,CAFK,IAAI/B,eACR,CAAC,4CAA4C,EAAEI,UAAU,GADrD,qBAAA;mBAAA;wBAAA;QAEN;IACF;IAEA,OAAOX,iBAAiB;QACtBiB,MAAMN;QACN2B,gBAAgBT,WAAWS,cAAc;QACzCF,gBAAgBxB,OAAOwB,cAAc;QACrCtB;QACAC;IACF;AACF"}
|
|
@@ -4,7 +4,7 @@ import { bold, purple } from '../../lib/picocolors';
|
|
|
4
4
|
import { PHASE_DEVELOPMENT_SERVER, PHASE_PRODUCTION_BUILD } from '../../shared/lib/constants';
|
|
5
5
|
import loadConfig, { getEnabledExperimentalFeatures } from '../config';
|
|
6
6
|
export function logStartInfo({ networkUrl, appUrl, envInfo, expFeatureInfo, maxExperimentalFeatures = Infinity }) {
|
|
7
|
-
Log.bootstrap(`${bold(purple(`${Log.prefixes.ready} Next.js ${"15.1.1-canary.
|
|
7
|
+
Log.bootstrap(`${bold(purple(`${Log.prefixes.ready} Next.js ${"15.1.1-canary.5"}`))}${process.env.TURBOPACK ? ' (Turbopack)' : ''}`);
|
|
8
8
|
if (appUrl) {
|
|
9
9
|
Log.bootstrap(`- Local: ${appUrl}`);
|
|
10
10
|
}
|
|
@@ -43,7 +43,7 @@ export async function getRequestHandlers({ dir, port, isDev, onDevServerCleanup,
|
|
|
43
43
|
export async function startServer(serverOptions) {
|
|
44
44
|
const { dir, isDev, hostname, minimalMode, allowRetry, keepAliveTimeout, selfSignedCertificate } = serverOptions;
|
|
45
45
|
let { port } = serverOptions;
|
|
46
|
-
process.title = `next-server (v${"15.1.1-canary.
|
|
46
|
+
process.title = `next-server (v${"15.1.1-canary.5"})`;
|
|
47
47
|
let handlersReady = ()=>{};
|
|
48
48
|
let handlersError = ()=>{};
|
|
49
49
|
let handlersPromise = new Promise((resolve, reject)=>{
|
|
@@ -35,15 +35,15 @@ import { isMetadataRoute } from '../lib/metadata/is-metadata-route';
|
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
async function loadClientReferenceManifest(manifestPath, entryName) {
|
|
38
|
+
async function loadClientReferenceManifest(manifestPath, entryName, attempts) {
|
|
39
39
|
try {
|
|
40
|
-
const context = await evalManifestWithRetries(manifestPath);
|
|
40
|
+
const context = await evalManifestWithRetries(manifestPath, attempts);
|
|
41
41
|
return context.__RSC_MANIFEST[entryName];
|
|
42
42
|
} catch (err) {
|
|
43
43
|
return undefined;
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
async function loadComponentsImpl({ distDir, page, isAppPath }) {
|
|
46
|
+
async function loadComponentsImpl({ distDir, page, isAppPath, isDev }) {
|
|
47
47
|
let DocumentMod = {};
|
|
48
48
|
let AppMod = {};
|
|
49
49
|
if (!isAppPath) {
|
|
@@ -55,14 +55,19 @@ async function loadComponentsImpl({ distDir, page, isAppPath }) {
|
|
|
55
55
|
}
|
|
56
56
|
// Make sure to avoid loading the manifest for metadata route handlers.
|
|
57
57
|
const hasClientManifest = isAppPath && !isMetadataRoute(page);
|
|
58
|
+
// In dev mode we retry loading a manifest file to handle a race condition
|
|
59
|
+
// that can occur while app and pages are compiling at the same time, and the
|
|
60
|
+
// build-manifest is still being written to disk while an app path is
|
|
61
|
+
// attempting to load.
|
|
62
|
+
const manifestLoadAttempts = isDev ? 3 : 1;
|
|
58
63
|
// Load the manifest files first
|
|
59
64
|
const [buildManifest, reactLoadableManifest, dynamicCssManifest, clientReferenceManifest, serverActionsManifest] = await Promise.all([
|
|
60
|
-
loadManifestWithRetries(join(distDir, BUILD_MANIFEST)),
|
|
61
|
-
loadManifestWithRetries(join(distDir, REACT_LOADABLE_MANIFEST)),
|
|
65
|
+
loadManifestWithRetries(join(distDir, BUILD_MANIFEST), manifestLoadAttempts),
|
|
66
|
+
loadManifestWithRetries(join(distDir, REACT_LOADABLE_MANIFEST), manifestLoadAttempts),
|
|
62
67
|
// This manifest will only exist in Pages dir && Production && Webpack.
|
|
63
|
-
isAppPath || process.env.TURBOPACK ? undefined : loadManifestWithRetries(join(distDir, `${DYNAMIC_CSS_MANIFEST}.json`)).catch(()=>undefined),
|
|
64
|
-
hasClientManifest ? loadClientReferenceManifest(join(distDir, 'server', 'app', page.replace(/%5F/g, '_') + '_' + CLIENT_REFERENCE_MANIFEST + '.js'), page.replace(/%5F/g, '_')) : undefined,
|
|
65
|
-
isAppPath ? loadManifestWithRetries(join(distDir, 'server', SERVER_REFERENCE_MANIFEST + '.json')).catch(()=>null) : null
|
|
68
|
+
isAppPath || process.env.TURBOPACK ? undefined : loadManifestWithRetries(join(distDir, `${DYNAMIC_CSS_MANIFEST}.json`), manifestLoadAttempts).catch(()=>undefined),
|
|
69
|
+
hasClientManifest ? loadClientReferenceManifest(join(distDir, 'server', 'app', page.replace(/%5F/g, '_') + '_' + CLIENT_REFERENCE_MANIFEST + '.js'), page.replace(/%5F/g, '_'), manifestLoadAttempts) : undefined,
|
|
70
|
+
isAppPath ? loadManifestWithRetries(join(distDir, 'server', SERVER_REFERENCE_MANIFEST + '.json'), manifestLoadAttempts).catch(()=>null) : null
|
|
66
71
|
]);
|
|
67
72
|
// Before requiring the actual page module, we have to set the reference
|
|
68
73
|
// manifests to our global store so Server Action's encryption util can access
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/server/load-components.ts"],"sourcesContent":["import type {\n AppType,\n DocumentType,\n NextComponentType,\n} from '../shared/lib/utils'\nimport type { ClientReferenceManifest } from '../build/webpack/plugins/flight-manifest-plugin'\nimport type {\n PageConfig,\n GetStaticPaths,\n GetServerSideProps,\n GetStaticProps,\n} from '../types'\nimport type { RouteModule } from './route-modules/route-module'\nimport type { BuildManifest } from './get-page-files'\nimport type { ActionManifest } from '../build/webpack/plugins/flight-client-entry-plugin'\n\nimport {\n BUILD_MANIFEST,\n REACT_LOADABLE_MANIFEST,\n CLIENT_REFERENCE_MANIFEST,\n SERVER_REFERENCE_MANIFEST,\n DYNAMIC_CSS_MANIFEST,\n} from '../shared/lib/constants'\nimport { join } from 'path'\nimport { requirePage } from './require'\nimport { interopDefault } from '../lib/interop-default'\nimport { getTracer } from './lib/trace/tracer'\nimport { LoadComponentsSpan } from './lib/trace/constants'\nimport { evalManifest, loadManifest } from './load-manifest'\nimport { wait } from '../lib/wait'\nimport { setReferenceManifestsSingleton } from './app-render/encryption-utils'\nimport { createServerModuleMap } from './app-render/action-utils'\nimport type { DeepReadonly } from '../shared/lib/deep-readonly'\nimport { isMetadataRoute } from '../lib/metadata/is-metadata-route'\n\nexport type ManifestItem = {\n id: number | string\n files: string[]\n}\n\nexport type ReactLoadableManifest = { [moduleId: string]: ManifestItem }\n/**\n * This manifest prevents removing server rendered <link> tags after client\n * navigation. This is only needed under `Pages dir && Production && Webpack`.\n * @see https://github.com/vercel/next.js/pull/72959\n */\nexport type DynamicCssManifest = string[]\n\n/**\n * A manifest entry type for the react-loadable-manifest.json.\n *\n * The whole manifest.json is a type of `Record<pathname, LoadableManifest>`\n * where pathname is a string-based key points to the path of the page contains\n * each dynamic imports.\n */\nexport interface LoadableManifest {\n [k: string]: { id: string | number; files: string[] }\n}\n\nexport type LoadComponentsReturnType<NextModule = any> = {\n Component: NextComponentType\n pageConfig: PageConfig\n buildManifest: DeepReadonly<BuildManifest>\n subresourceIntegrityManifest?: DeepReadonly<Record<string, string>>\n reactLoadableManifest: DeepReadonly<ReactLoadableManifest>\n dynamicCssManifest?: DeepReadonly<DynamicCssManifest>\n clientReferenceManifest?: DeepReadonly<ClientReferenceManifest>\n serverActionsManifest?: any\n Document: DocumentType\n App: AppType\n getStaticProps?: GetStaticProps\n getStaticPaths?: GetStaticPaths\n getServerSideProps?: GetServerSideProps\n ComponentMod: NextModule\n routeModule: RouteModule\n isAppPath?: boolean\n page: string\n multiZoneDraftMode?: boolean\n}\n\n/**\n * Load manifest file with retries, defaults to 3 attempts.\n */\nexport async function loadManifestWithRetries<T extends object>(\n manifestPath: string,\n attempts = 3\n) {\n while (true) {\n try {\n return loadManifest<T>(manifestPath)\n } catch (err) {\n attempts--\n if (attempts <= 0) throw err\n\n await wait(100)\n }\n }\n}\n\n/**\n * Load manifest file with retries, defaults to 3 attempts.\n */\nexport async function evalManifestWithRetries<T extends object>(\n manifestPath: string,\n attempts = 3\n) {\n while (true) {\n try {\n return evalManifest<T>(manifestPath)\n } catch (err) {\n attempts--\n if (attempts <= 0) throw err\n\n await wait(100)\n }\n }\n}\n\nasync function loadClientReferenceManifest(\n manifestPath: string,\n entryName: string\n) {\n try {\n const context = await evalManifestWithRetries<{\n __RSC_MANIFEST: { [key: string]: ClientReferenceManifest }\n }>(manifestPath)\n return context.__RSC_MANIFEST[entryName]\n } catch (err) {\n return undefined\n }\n}\n\nasync function loadComponentsImpl<N = any>({\n distDir,\n page,\n isAppPath,\n}: {\n distDir: string\n page: string\n isAppPath: boolean\n}): Promise<LoadComponentsReturnType<N>> {\n let DocumentMod = {}\n let AppMod = {}\n if (!isAppPath) {\n ;[DocumentMod, AppMod] = await Promise.all([\n requirePage('/_document', distDir, false),\n requirePage('/_app', distDir, false),\n ])\n }\n\n // Make sure to avoid loading the manifest for metadata route handlers.\n const hasClientManifest = isAppPath && !isMetadataRoute(page)\n\n // Load the manifest files first\n const [\n buildManifest,\n reactLoadableManifest,\n dynamicCssManifest,\n clientReferenceManifest,\n serverActionsManifest,\n ] = await Promise.all([\n loadManifestWithRetries<BuildManifest>(join(distDir, BUILD_MANIFEST)),\n loadManifestWithRetries<ReactLoadableManifest>(\n join(distDir, REACT_LOADABLE_MANIFEST)\n ),\n // This manifest will only exist in Pages dir && Production && Webpack.\n isAppPath || process.env.TURBOPACK\n ? undefined\n : loadManifestWithRetries<DynamicCssManifest>(\n join(distDir, `${DYNAMIC_CSS_MANIFEST}.json`)\n ).catch(() => undefined),\n hasClientManifest\n ? loadClientReferenceManifest(\n join(\n distDir,\n 'server',\n 'app',\n page.replace(/%5F/g, '_') + '_' + CLIENT_REFERENCE_MANIFEST + '.js'\n ),\n page.replace(/%5F/g, '_')\n )\n : undefined,\n isAppPath\n ? loadManifestWithRetries<ActionManifest>(\n join(distDir, 'server', SERVER_REFERENCE_MANIFEST + '.json')\n ).catch(() => null)\n : null,\n ])\n\n // Before requiring the actual page module, we have to set the reference\n // manifests to our global store so Server Action's encryption util can access\n // to them at the top level of the page module.\n if (serverActionsManifest && clientReferenceManifest) {\n setReferenceManifestsSingleton({\n page,\n clientReferenceManifest,\n serverActionsManifest,\n serverModuleMap: createServerModuleMap({\n serverActionsManifest,\n }),\n })\n }\n\n const ComponentMod = await requirePage(page, distDir, isAppPath)\n\n const Component = interopDefault(ComponentMod)\n const Document = interopDefault(DocumentMod)\n const App = interopDefault(AppMod)\n\n const { getServerSideProps, getStaticProps, getStaticPaths, routeModule } =\n ComponentMod\n\n return {\n App,\n Document,\n Component,\n buildManifest,\n reactLoadableManifest,\n dynamicCssManifest,\n pageConfig: ComponentMod.config || {},\n ComponentMod,\n getServerSideProps,\n getStaticProps,\n getStaticPaths,\n clientReferenceManifest,\n serverActionsManifest,\n isAppPath,\n page,\n routeModule,\n }\n}\n\nexport const loadComponents = getTracer().wrap(\n LoadComponentsSpan.loadComponents,\n loadComponentsImpl\n)\n"],"names":["BUILD_MANIFEST","REACT_LOADABLE_MANIFEST","CLIENT_REFERENCE_MANIFEST","SERVER_REFERENCE_MANIFEST","DYNAMIC_CSS_MANIFEST","join","requirePage","interopDefault","getTracer","LoadComponentsSpan","evalManifest","loadManifest","wait","setReferenceManifestsSingleton","createServerModuleMap","isMetadataRoute","loadManifestWithRetries","manifestPath","attempts","err","evalManifestWithRetries","loadClientReferenceManifest","entryName","context","__RSC_MANIFEST","undefined","loadComponentsImpl","distDir","page","isAppPath","DocumentMod","AppMod","Promise","all","hasClientManifest","buildManifest","reactLoadableManifest","dynamicCssManifest","clientReferenceManifest","serverActionsManifest","process","env","TURBOPACK","catch","replace","serverModuleMap","ComponentMod","Component","Document","App","getServerSideProps","getStaticProps","getStaticPaths","routeModule","pageConfig","config","loadComponents","wrap"],"mappings":"AAgBA,SACEA,cAAc,EACdC,uBAAuB,EACvBC,yBAAyB,EACzBC,yBAAyB,EACzBC,oBAAoB,QACf,0BAAyB;AAChC,SAASC,IAAI,QAAQ,OAAM;AAC3B,SAASC,WAAW,QAAQ,YAAW;AACvC,SAASC,cAAc,QAAQ,yBAAwB;AACvD,SAASC,SAAS,QAAQ,qBAAoB;AAC9C,SAASC,kBAAkB,QAAQ,wBAAuB;AAC1D,SAASC,YAAY,EAAEC,YAAY,QAAQ,kBAAiB;AAC5D,SAASC,IAAI,QAAQ,cAAa;AAClC,SAASC,8BAA8B,QAAQ,gCAA+B;AAC9E,SAASC,qBAAqB,QAAQ,4BAA2B;AAEjE,SAASC,eAAe,QAAQ,oCAAmC;AA+CnE;;CAEC,GACD,OAAO,eAAeC,wBACpBC,YAAoB,EACpBC,WAAW,CAAC;IAEZ,MAAO,KAAM;QACX,IAAI;YACF,OAAOP,aAAgBM;QACzB,EAAE,OAAOE,KAAK;YACZD;YACA,IAAIA,YAAY,GAAG,MAAMC;YAEzB,MAAMP,KAAK;QACb;IACF;AACF;AAEA;;CAEC,GACD,OAAO,eAAeQ,wBACpBH,YAAoB,EACpBC,WAAW,CAAC;IAEZ,MAAO,KAAM;QACX,IAAI;YACF,OAAOR,aAAgBO;QACzB,EAAE,OAAOE,KAAK;YACZD;YACA,IAAIA,YAAY,GAAG,MAAMC;YAEzB,MAAMP,KAAK;Q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MAAMO,eAAe,MAAMxC,YAAYsB,MAAMD,SAASE;IAEtD,MAAMkB,YAAYxC,eAAeuC;IACjC,MAAME,WAAWzC,eAAeuB;IAChC,MAAMmB,MAAM1C,eAAewB;IAE3B,MAAM,EAAEmB,kBAAkB,EAAEC,cAAc,EAAEC,cAAc,EAAEC,WAAW,EAAE,GACvEP;IAEF,OAAO;QACLG;QACAD;QACAD;QACAZ;QACAC;QACAC;QACAiB,YAAYR,aAAaS,MAAM,IAAI,CAAC;QACpCT;QACAI;QACAC;QACAC;QACAd;QACAC;QACAV;QACAD;QACAyB;IACF;AACF;AAEA,OAAO,MAAMG,iBAAiBhD,YAAYiD,IAAI,CAC5ChD,mBAAmB+C,cAAc,EACjC9B,oBACD"}
|
|
1
|
+
{"version":3,"sources":["../../src/server/load-components.ts"],"sourcesContent":["import type {\n AppType,\n DocumentType,\n NextComponentType,\n} from '../shared/lib/utils'\nimport type { ClientReferenceManifest } from '../build/webpack/plugins/flight-manifest-plugin'\nimport type {\n PageConfig,\n GetStaticPaths,\n GetServerSideProps,\n GetStaticProps,\n} from '../types'\nimport type { RouteModule } from './route-modules/route-module'\nimport type { BuildManifest } from './get-page-files'\nimport type { ActionManifest } from '../build/webpack/plugins/flight-client-entry-plugin'\n\nimport {\n BUILD_MANIFEST,\n REACT_LOADABLE_MANIFEST,\n CLIENT_REFERENCE_MANIFEST,\n SERVER_REFERENCE_MANIFEST,\n DYNAMIC_CSS_MANIFEST,\n} from '../shared/lib/constants'\nimport { join } from 'path'\nimport { requirePage } from './require'\nimport { interopDefault } from '../lib/interop-default'\nimport { getTracer } from './lib/trace/tracer'\nimport { LoadComponentsSpan } from './lib/trace/constants'\nimport { evalManifest, loadManifest } from './load-manifest'\nimport { wait } from '../lib/wait'\nimport { setReferenceManifestsSingleton } from './app-render/encryption-utils'\nimport { createServerModuleMap } from './app-render/action-utils'\nimport type { DeepReadonly } from '../shared/lib/deep-readonly'\nimport { isMetadataRoute } from '../lib/metadata/is-metadata-route'\n\nexport type ManifestItem = {\n id: number | string\n files: string[]\n}\n\nexport type ReactLoadableManifest = { [moduleId: string]: ManifestItem }\n/**\n * This manifest prevents removing server rendered <link> tags after client\n * navigation. This is only needed under `Pages dir && Production && Webpack`.\n * @see https://github.com/vercel/next.js/pull/72959\n */\nexport type DynamicCssManifest = string[]\n\n/**\n * A manifest entry type for the react-loadable-manifest.json.\n *\n * The whole manifest.json is a type of `Record<pathname, LoadableManifest>`\n * where pathname is a string-based key points to the path of the page contains\n * each dynamic imports.\n */\nexport interface LoadableManifest {\n [k: string]: { id: string | number; files: string[] }\n}\n\nexport type LoadComponentsReturnType<NextModule = any> = {\n Component: NextComponentType\n pageConfig: PageConfig\n buildManifest: DeepReadonly<BuildManifest>\n subresourceIntegrityManifest?: DeepReadonly<Record<string, string>>\n reactLoadableManifest: DeepReadonly<ReactLoadableManifest>\n dynamicCssManifest?: DeepReadonly<DynamicCssManifest>\n clientReferenceManifest?: DeepReadonly<ClientReferenceManifest>\n serverActionsManifest?: any\n Document: DocumentType\n App: AppType\n getStaticProps?: GetStaticProps\n getStaticPaths?: GetStaticPaths\n getServerSideProps?: GetServerSideProps\n ComponentMod: NextModule\n routeModule: RouteModule\n isAppPath?: boolean\n page: string\n multiZoneDraftMode?: boolean\n}\n\n/**\n * Load manifest file with retries, defaults to 3 attempts.\n */\nexport async function loadManifestWithRetries<T extends object>(\n manifestPath: string,\n attempts = 3\n) {\n while (true) {\n try {\n return loadManifest<T>(manifestPath)\n } catch (err) {\n attempts--\n if (attempts <= 0) throw err\n\n await wait(100)\n }\n }\n}\n\n/**\n * Load manifest file with retries, defaults to 3 attempts.\n */\nexport async function evalManifestWithRetries<T extends object>(\n manifestPath: string,\n attempts = 3\n) {\n while (true) {\n try {\n return evalManifest<T>(manifestPath)\n } catch (err) {\n attempts--\n if (attempts <= 0) throw err\n\n await wait(100)\n }\n }\n}\n\nasync function loadClientReferenceManifest(\n manifestPath: string,\n entryName: string,\n attempts?: number\n) {\n try {\n const context = await evalManifestWithRetries<{\n __RSC_MANIFEST: { [key: string]: ClientReferenceManifest }\n }>(manifestPath, attempts)\n return context.__RSC_MANIFEST[entryName]\n } catch (err) {\n return undefined\n }\n}\n\nasync function loadComponentsImpl<N = any>({\n distDir,\n page,\n isAppPath,\n isDev,\n}: {\n distDir: string\n page: string\n isAppPath: boolean\n isDev: boolean\n}): Promise<LoadComponentsReturnType<N>> {\n let DocumentMod = {}\n let AppMod = {}\n if (!isAppPath) {\n ;[DocumentMod, AppMod] = await Promise.all([\n requirePage('/_document', distDir, false),\n requirePage('/_app', distDir, false),\n ])\n }\n\n // Make sure to avoid loading the manifest for metadata route handlers.\n const hasClientManifest = isAppPath && !isMetadataRoute(page)\n\n // In dev mode we retry loading a manifest file to handle a race condition\n // that can occur while app and pages are compiling at the same time, and the\n // build-manifest is still being written to disk while an app path is\n // attempting to load.\n const manifestLoadAttempts = isDev ? 3 : 1\n\n // Load the manifest files first\n const [\n buildManifest,\n reactLoadableManifest,\n dynamicCssManifest,\n clientReferenceManifest,\n serverActionsManifest,\n ] = await Promise.all([\n loadManifestWithRetries<BuildManifest>(\n join(distDir, BUILD_MANIFEST),\n manifestLoadAttempts\n ),\n loadManifestWithRetries<ReactLoadableManifest>(\n join(distDir, REACT_LOADABLE_MANIFEST),\n manifestLoadAttempts\n ),\n // This manifest will only exist in Pages dir && Production && Webpack.\n isAppPath || process.env.TURBOPACK\n ? undefined\n : loadManifestWithRetries<DynamicCssManifest>(\n join(distDir, `${DYNAMIC_CSS_MANIFEST}.json`),\n manifestLoadAttempts\n ).catch(() => undefined),\n hasClientManifest\n ? loadClientReferenceManifest(\n join(\n distDir,\n 'server',\n 'app',\n page.replace(/%5F/g, '_') + '_' + CLIENT_REFERENCE_MANIFEST + '.js'\n ),\n page.replace(/%5F/g, '_'),\n manifestLoadAttempts\n )\n : undefined,\n isAppPath\n ? loadManifestWithRetries<ActionManifest>(\n join(distDir, 'server', SERVER_REFERENCE_MANIFEST + '.json'),\n manifestLoadAttempts\n ).catch(() => null)\n : null,\n ])\n\n // Before requiring the actual page module, we have to set the reference\n // manifests to our global store so Server Action's encryption util can access\n // to them at the top level of the page module.\n if (serverActionsManifest && clientReferenceManifest) {\n setReferenceManifestsSingleton({\n page,\n clientReferenceManifest,\n serverActionsManifest,\n serverModuleMap: createServerModuleMap({\n serverActionsManifest,\n }),\n })\n }\n\n const ComponentMod = await requirePage(page, distDir, isAppPath)\n\n const Component = interopDefault(ComponentMod)\n const Document = interopDefault(DocumentMod)\n const App = interopDefault(AppMod)\n\n const { getServerSideProps, getStaticProps, getStaticPaths, routeModule } =\n ComponentMod\n\n return {\n App,\n Document,\n Component,\n buildManifest,\n reactLoadableManifest,\n dynamicCssManifest,\n pageConfig: ComponentMod.config || {},\n ComponentMod,\n getServerSideProps,\n getStaticProps,\n getStaticPaths,\n clientReferenceManifest,\n serverActionsManifest,\n isAppPath,\n page,\n routeModule,\n }\n}\n\nexport const loadComponents = getTracer().wrap(\n LoadComponentsSpan.loadComponents,\n loadComponentsImpl\n)\n"],"names":["BUILD_MANIFEST","REACT_LOADABLE_MANIFEST","CLIENT_REFERENCE_MANIFEST","SERVER_REFERENCE_MANIFEST","DYNAMIC_CSS_MANIFEST","join","requirePage","interopDefault","getTracer","LoadComponentsSpan","evalManifest","loadManifest","wait","setReferenceManifestsSingleton","createServerModuleMap","isMetadataRoute","loadManifestWithRetries","manifestPath","attempts","err","evalManifestWithRetries","loadClientReferenceManifest","entryName","context","__RSC_MANIFEST","undefined","loadComponentsImpl","distDir","page","isAppPath","isDev","DocumentMod","AppMod","Promise","all","hasClientManifest","manifestLoadAttempts","buildManifest","reactLoadableManifest","dynamicCssManifest","clientReferenceManifest","serverActionsManifest","process","env","TURBOPACK","catch","replace","serverModuleMap","ComponentMod","Component","Document","App","getServerSideProps","getStaticProps","getStaticPaths","routeModule","pageConfig","config","loadComponents","wrap"],"mappings":"AAgBA,SACEA,cAAc,EACdC,uBAAuB,EACvBC,yBAAyB,EACzBC,yBAA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ACAC;QACAC;QACAiB,YAAYR,aAAaS,MAAM,IAAI,CAAC;QACpCT;QACAI;QACAC;QACAC;QACAd;QACAC;QACAZ;QACAD;QACA2B;IACF;AACF;AAEA,OAAO,MAAMG,iBAAiBlD,YAAYmD,IAAI,CAC5ClD,mBAAmBiD,cAAc,EACjChC,oBACD"}
|
|
@@ -320,6 +320,7 @@ export default class NextNodeServer extends BaseServer {
|
|
|
320
320
|
}
|
|
321
321
|
return result.finished;
|
|
322
322
|
};
|
|
323
|
+
this.isDev = options.dev ?? false;
|
|
323
324
|
/**
|
|
324
325
|
* This sets environment variable to be used at the time of SSR by head.tsx.
|
|
325
326
|
* Using this from process.env allows targeting SSR by calling
|
|
@@ -342,12 +343,14 @@ export default class NextNodeServer extends BaseServer {
|
|
|
342
343
|
loadComponents({
|
|
343
344
|
distDir: this.distDir,
|
|
344
345
|
page: '/_document',
|
|
345
|
-
isAppPath: false
|
|
346
|
+
isAppPath: false,
|
|
347
|
+
isDev: this.isDev
|
|
346
348
|
}).catch(()=>{});
|
|
347
349
|
loadComponents({
|
|
348
350
|
distDir: this.distDir,
|
|
349
351
|
page: '/_app',
|
|
350
|
-
isAppPath: false
|
|
352
|
+
isAppPath: false,
|
|
353
|
+
isDev: this.isDev
|
|
351
354
|
}).catch(()=>{});
|
|
352
355
|
}
|
|
353
356
|
if (!options.dev && !this.minimalMode && this.nextConfig.experimental.preloadEntriesOnStart) {
|
|
@@ -392,14 +395,16 @@ export default class NextNodeServer extends BaseServer {
|
|
|
392
395
|
await loadComponents({
|
|
393
396
|
distDir: this.distDir,
|
|
394
397
|
page,
|
|
395
|
-
isAppPath: false
|
|
398
|
+
isAppPath: false,
|
|
399
|
+
isDev: this.isDev
|
|
396
400
|
}).catch(()=>{});
|
|
397
401
|
}
|
|
398
402
|
for (const page of Object.keys(appPathsManifest || {})){
|
|
399
403
|
await loadComponents({
|
|
400
404
|
distDir: this.distDir,
|
|
401
405
|
page,
|
|
402
|
-
isAppPath: true
|
|
406
|
+
isAppPath: true,
|
|
407
|
+
isDev: this.isDev
|
|
403
408
|
}).then(async ({ ComponentMod })=>{
|
|
404
409
|
// we need to ensure fetch is patched before we require the page,
|
|
405
410
|
// otherwise if the fetch is patched by user code, we will be patching it
|
|
@@ -708,7 +713,8 @@ export default class NextNodeServer extends BaseServer {
|
|
|
708
713
|
const components = await loadComponents({
|
|
709
714
|
distDir: this.distDir,
|
|
710
715
|
page: pagePath,
|
|
711
|
-
isAppPath
|
|
716
|
+
isAppPath,
|
|
717
|
+
isDev: this.isDev
|
|
712
718
|
});
|
|
713
719
|
if (query.__nextLocale && typeof components.Component === 'string' && !pagePath.startsWith(`/${query.__nextLocale}`)) {
|
|
714
720
|
continue;
|