next 15.5.1-canary.33 → 15.5.1-canary.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/next +1 -1
- package/dist/build/index.js +2 -2
- package/dist/build/load-jsconfig.js +1 -1
- package/dist/build/load-jsconfig.js.map +1 -1
- package/dist/build/next-config-ts/transpile-config.js +2 -1
- package/dist/build/next-config-ts/transpile-config.js.map +1 -1
- package/dist/build/swc/index.js +1 -1
- package/dist/build/webpack-config.js +2 -2
- package/dist/cli/next-test.js +1 -1
- package/dist/cli/next-test.js.map +1 -1
- package/dist/client/app-bootstrap.js +1 -1
- package/dist/client/index.js +1 -1
- package/dist/compiled/next-server/pages-api.runtime.prod.js +1 -1
- package/dist/compiled/next-server/pages-api.runtime.prod.js.map +1 -1
- package/dist/compiled/next-server/pages.runtime.prod.js +1 -1
- package/dist/compiled/next-server/pages.runtime.prod.js.map +1 -1
- package/dist/esm/build/index.js +2 -2
- package/dist/esm/build/load-jsconfig.js +1 -1
- package/dist/esm/build/load-jsconfig.js.map +1 -1
- package/dist/esm/build/next-config-ts/transpile-config.js +2 -1
- package/dist/esm/build/next-config-ts/transpile-config.js.map +1 -1
- package/dist/esm/build/swc/index.js +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/lib/eslint/runLintCheck.js +1 -1
- package/dist/esm/lib/eslint/runLintCheck.js.map +1 -1
- package/dist/esm/lib/has-necessary-dependencies.js +9 -7
- package/dist/esm/lib/has-necessary-dependencies.js.map +1 -1
- package/dist/esm/lib/verify-partytown-setup.js +1 -1
- package/dist/esm/lib/verify-partytown-setup.js.map +1 -1
- package/dist/esm/lib/verify-typescript-setup.js +2 -2
- package/dist/esm/lib/verify-typescript-setup.js.map +1 -1
- package/dist/esm/server/dev/hot-reloader-turbopack.js +13 -3
- package/dist/esm/server/dev/hot-reloader-turbopack.js.map +1 -1
- package/dist/esm/server/dev/hot-reloader-webpack.js +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/shared/lib/canary-only.js +1 -1
- package/dist/lib/eslint/runLintCheck.js +1 -1
- package/dist/lib/eslint/runLintCheck.js.map +1 -1
- package/dist/lib/has-necessary-dependencies.d.ts +1 -1
- package/dist/lib/has-necessary-dependencies.js +8 -6
- package/dist/lib/has-necessary-dependencies.js.map +1 -1
- package/dist/lib/verify-partytown-setup.js +1 -1
- package/dist/lib/verify-partytown-setup.js.map +1 -1
- package/dist/lib/verify-typescript-setup.js +2 -2
- package/dist/lib/verify-typescript-setup.js.map +1 -1
- package/dist/server/dev/hot-reloader-turbopack.js +13 -3
- package/dist/server/dev/hot-reloader-turbopack.js.map +1 -1
- package/dist/server/dev/hot-reloader-webpack.js +1 -1
- package/dist/server/lib/app-info-log.js +1 -1
- package/dist/server/lib/start-server.js +1 -1
- package/dist/shared/lib/canary-only.js +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
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../src/lib/has-necessary-dependencies.ts"],"sourcesContent":["import { existsSync,
|
1
|
+
{"version":3,"sources":["../../src/lib/has-necessary-dependencies.ts"],"sourcesContent":["import { existsSync, realpathSync } from 'fs'\nimport { resolveFrom } from './resolve-from'\nimport { dirname, join, relative } from 'path'\n\nexport interface MissingDependency {\n file: string\n /**\n * The package's package.json (e.g. require(`${pkg}/package.json`)) MUST resolve.\n * If `exportsRestrict` is false, `${file}` MUST also resolve.\n */\n pkg: string\n /**\n * If true, the pkg's package.json needs to be resolvable.\n * If true, will resolve `file` relative to the real path of the package.json.\n *\n * For example, `{ file: '@types/react/index.d.ts', pkg: '@types/react', exportsRestrict: true }`\n * will try to resolve '@types/react/package.json' first and then assume `@types/react/index.d.ts`\n * resolves to `path.join(dirname(resolvedPackageJsonPath), 'index.d.ts')`.\n *\n * If false, will resolve `file` relative to the baseDir.\n * ForFor example, `{ file: '@types/react/index.d.ts', pkg: '@types/react', exportsRestrict: true }`\n * will try to resolve `@types/react/index.d.ts` directly.\n */\n exportsRestrict: boolean\n}\n\nexport type NecessaryDependencies = {\n resolved: Map<string, string>\n missing: MissingDependency[]\n}\n\nexport function hasNecessaryDependencies(\n baseDir: string,\n requiredPackages: MissingDependency[]\n): NecessaryDependencies {\n let resolutions = new Map<string, string>()\n const missingPackages: MissingDependency[] = []\n\n for (const p of requiredPackages) {\n try {\n const pkgPath = realpathSync(\n resolveFrom(baseDir, `${p.pkg}/package.json`)\n )\n const pkgDir = dirname(pkgPath)\n\n if (p.exportsRestrict) {\n const fileNameToVerify = relative(p.pkg, p.file)\n if (fileNameToVerify) {\n const fileToVerify = join(pkgDir, fileNameToVerify)\n if (existsSync(fileToVerify)) {\n resolutions.set(p.pkg, fileToVerify)\n } else {\n missingPackages.push(p)\n continue\n }\n } else {\n resolutions.set(p.pkg, pkgPath)\n }\n } else {\n resolutions.set(p.pkg, resolveFrom(baseDir, p.file))\n }\n } catch (_) {\n missingPackages.push(p)\n continue\n }\n }\n\n return {\n resolved: resolutions,\n missing: missingPackages,\n }\n}\n"],"names":["hasNecessaryDependencies","baseDir","requiredPackages","resolutions","Map","missingPackages","p","pkgPath","realpathSync","resolveFrom","pkg","pkgDir","dirname","exportsRestrict","fileNameToVerify","relative","file","fileToVerify","join","existsSync","set","push","_","resolved","missing"],"mappings":";;;;+BA+BgBA;;;eAAAA;;;oBA/ByB;6BACb;sBACY;AA6BjC,SAASA,yBACdC,OAAe,EACfC,gBAAqC;IAErC,IAAIC,cAAc,IAAIC;IACtB,MAAMC,kBAAuC,EAAE;IAE/C,KAAK,MAAMC,KAAKJ,iBAAkB;QAChC,IAAI;YACF,MAAMK,UAAUC,IAAAA,gBAAY,EAC1BC,IAAAA,wBAAW,EAACR,SAAS,GAAGK,EAAEI,GAAG,CAAC,aAAa,CAAC;YAE9C,MAAMC,SAASC,IAAAA,aAAO,EAACL;YAEvB,IAAID,EAAEO,eAAe,EAAE;gBACrB,MAAMC,mBAAmBC,IAAAA,cAAQ,EAACT,EAAEI,GAAG,EAAEJ,EAAEU,IAAI;gBAC/C,IAAIF,kBAAkB;oBACpB,MAAMG,eAAeC,IAAAA,UAAI,EAACP,QAAQG;oBAClC,IAAIK,IAAAA,cAAU,EAACF,eAAe;wBAC5Bd,YAAYiB,GAAG,CAACd,EAAEI,GAAG,EAAEO;oBACzB,OAAO;wBACLZ,gBAAgBgB,IAAI,CAACf;wBACrB;oBACF;gBACF,OAAO;oBACLH,YAAYiB,GAAG,CAACd,EAAEI,GAAG,EAAEH;gBACzB;YACF,OAAO;gBACLJ,YAAYiB,GAAG,CAACd,EAAEI,GAAG,EAAED,IAAAA,wBAAW,EAACR,SAASK,EAAEU,IAAI;YACpD;QACF,EAAE,OAAOM,GAAG;YACVjB,gBAAgBgB,IAAI,CAACf;YACrB;QACF;IACF;IAEA,OAAO;QACLiB,UAAUpB;QACVqB,SAASnB;IACX;AACF","ignoreList":[0]}
|
@@ -85,7 +85,7 @@ async function copyPartytownStaticFiles(deps, staticDir) {
|
|
85
85
|
async function verifyPartytownSetup(dir, targetDir) {
|
86
86
|
try {
|
87
87
|
var _partytownDeps_missing;
|
88
|
-
const partytownDeps =
|
88
|
+
const partytownDeps = (0, _hasnecessarydependencies.hasNecessaryDependencies)(dir, [
|
89
89
|
{
|
90
90
|
file: '@builder.io/partytown',
|
91
91
|
pkg: '@builder.io/partytown',
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../src/lib/verify-partytown-setup.ts"],"sourcesContent":["import { promises } from 'fs'\nimport { bold, cyan, red } from './picocolors'\n\nimport path from 'path'\nimport { hasNecessaryDependencies } from './has-necessary-dependencies'\nimport type { NecessaryDependencies } from './has-necessary-dependencies'\nimport { fileExists, FileType } from './file-exists'\nimport { FatalError } from './fatal-error'\nimport * as Log from '../build/output/log'\nimport { getPkgManager } from './helpers/get-pkg-manager'\n\nasync function missingDependencyError(dir: string) {\n const packageManager = getPkgManager(dir)\n\n throw new FatalError(\n bold(\n red(\n \"It looks like you're trying to use Partytown with next/script but do not have the required package(s) installed.\"\n )\n ) +\n '\\n\\n' +\n bold(`Please install Partytown by running:`) +\n '\\n\\n' +\n `\\t${bold(\n cyan(\n (packageManager === 'yarn'\n ? 'yarn add --dev'\n : packageManager === 'pnpm'\n ? 'pnpm install --save-dev'\n : 'npm install --save-dev') + ' @builder.io/partytown'\n )\n )}` +\n '\\n\\n' +\n bold(\n `If you are not trying to use Partytown, please disable the experimental ${cyan(\n '\"nextScriptWorkers\"'\n )} flag in next.config.js.`\n ) +\n '\\n'\n )\n}\n\nasync function copyPartytownStaticFiles(\n deps: NecessaryDependencies,\n staticDir: string\n) {\n const partytownLibDir = path.join(staticDir, '~partytown')\n const hasPartytownLibDir = await fileExists(\n partytownLibDir,\n FileType.Directory\n )\n\n if (hasPartytownLibDir) {\n await promises.rm(partytownLibDir, { recursive: true, force: true })\n }\n\n const { copyLibFiles } = await Promise.resolve(\n require(path.join(deps.resolved.get('@builder.io/partytown')!, '../utils'))\n )\n\n await copyLibFiles(partytownLibDir)\n}\n\nexport async function verifyPartytownSetup(\n dir: string,\n targetDir: string\n): Promise<void> {\n try {\n const partytownDeps: NecessaryDependencies =
|
1
|
+
{"version":3,"sources":["../../src/lib/verify-partytown-setup.ts"],"sourcesContent":["import { promises } from 'fs'\nimport { bold, cyan, red } from './picocolors'\n\nimport path from 'path'\nimport { hasNecessaryDependencies } from './has-necessary-dependencies'\nimport type { NecessaryDependencies } from './has-necessary-dependencies'\nimport { fileExists, FileType } from './file-exists'\nimport { FatalError } from './fatal-error'\nimport * as Log from '../build/output/log'\nimport { getPkgManager } from './helpers/get-pkg-manager'\n\nasync function missingDependencyError(dir: string) {\n const packageManager = getPkgManager(dir)\n\n throw new FatalError(\n bold(\n red(\n \"It looks like you're trying to use Partytown with next/script but do not have the required package(s) installed.\"\n )\n ) +\n '\\n\\n' +\n bold(`Please install Partytown by running:`) +\n '\\n\\n' +\n `\\t${bold(\n cyan(\n (packageManager === 'yarn'\n ? 'yarn add --dev'\n : packageManager === 'pnpm'\n ? 'pnpm install --save-dev'\n : 'npm install --save-dev') + ' @builder.io/partytown'\n )\n )}` +\n '\\n\\n' +\n bold(\n `If you are not trying to use Partytown, please disable the experimental ${cyan(\n '\"nextScriptWorkers\"'\n )} flag in next.config.js.`\n ) +\n '\\n'\n )\n}\n\nasync function copyPartytownStaticFiles(\n deps: NecessaryDependencies,\n staticDir: string\n) {\n const partytownLibDir = path.join(staticDir, '~partytown')\n const hasPartytownLibDir = await fileExists(\n partytownLibDir,\n FileType.Directory\n )\n\n if (hasPartytownLibDir) {\n await promises.rm(partytownLibDir, { recursive: true, force: true })\n }\n\n const { copyLibFiles } = await Promise.resolve(\n require(path.join(deps.resolved.get('@builder.io/partytown')!, '../utils'))\n )\n\n await copyLibFiles(partytownLibDir)\n}\n\nexport async function verifyPartytownSetup(\n dir: string,\n targetDir: string\n): Promise<void> {\n try {\n const partytownDeps: NecessaryDependencies = hasNecessaryDependencies(dir, [\n {\n file: '@builder.io/partytown',\n pkg: '@builder.io/partytown',\n exportsRestrict: false,\n },\n ])\n\n if (partytownDeps.missing?.length > 0) {\n await missingDependencyError(dir)\n } else {\n try {\n await copyPartytownStaticFiles(partytownDeps, targetDir)\n } catch (err) {\n Log.warn(\n `Partytown library files could not be copied to the static directory. Please ensure that ${bold(\n cyan('@builder.io/partytown')\n )} is installed as a dependency.`\n )\n }\n }\n } catch (err) {\n // Don't show a stack trace when there is an error due to missing dependencies\n if (err instanceof FatalError) {\n console.error(err.message)\n process.exit(1)\n }\n throw err\n }\n}\n"],"names":["verifyPartytownSetup","missingDependencyError","dir","packageManager","getPkgManager","FatalError","bold","red","cyan","copyPartytownStaticFiles","deps","staticDir","partytownLibDir","path","join","hasPartytownLibDir","fileExists","FileType","Directory","promises","rm","recursive","force","copyLibFiles","Promise","resolve","require","resolved","get","targetDir","partytownDeps","hasNecessaryDependencies","file","pkg","exportsRestrict","missing","length","err","Log","warn","console","error","message","process","exit"],"mappings":";;;;+BA+DsBA;;;eAAAA;;;oBA/DG;4BACO;6DAEf;0CACwB;4BAEJ;4BACV;6DACN;+BACS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE9B,eAAeC,uBAAuBC,GAAW;IAC/C,MAAMC,iBAAiBC,IAAAA,4BAAa,EAACF;IAErC,MAAM,qBAyBL,CAzBK,IAAIG,sBAAU,CAClBC,IAAAA,gBAAI,EACFC,IAAAA,eAAG,EACD,uHAGF,SACAD,IAAAA,gBAAI,EAAC,CAAC,oCAAoC,CAAC,IAC3C,SACA,CAAC,EAAE,EAAEA,IAAAA,gBAAI,EACPE,IAAAA,gBAAI,EACF,AAACL,CAAAA,mBAAmB,SAChB,mBACAA,mBAAmB,SACjB,4BACA,wBAAuB,IAAK,4BAEnC,GACH,SACAG,IAAAA,gBAAI,EACF,CAAC,wEAAwE,EAAEE,IAAAA,gBAAI,EAC7E,uBACA,wBAAwB,CAAC,IAE7B,OAxBE,qBAAA;eAAA;oBAAA;sBAAA;IAyBN;AACF;AAEA,eAAeC,yBACbC,IAA2B,EAC3BC,SAAiB;IAEjB,MAAMC,kBAAkBC,aAAI,CAACC,IAAI,CAACH,WAAW;IAC7C,MAAMI,qBAAqB,MAAMC,IAAAA,sBAAU,EACzCJ,iBACAK,oBAAQ,CAACC,SAAS;IAGpB,IAAIH,oBAAoB;QACtB,MAAMI,YAAQ,CAACC,EAAE,CAACR,iBAAiB;YAAES,WAAW;YAAMC,OAAO;QAAK;IACpE;IAEA,MAAM,EAAEC,YAAY,EAAE,GAAG,MAAMC,QAAQC,OAAO,CAC5CC,QAAQb,aAAI,CAACC,IAAI,CAACJ,KAAKiB,QAAQ,CAACC,GAAG,CAAC,0BAA2B;IAGjE,MAAML,aAAaX;AACrB;AAEO,eAAeZ,qBACpBE,GAAW,EACX2B,SAAiB;IAEjB,IAAI;YASEC;QARJ,MAAMA,gBAAuCC,IAAAA,kDAAwB,EAAC7B,KAAK;YACzE;gBACE8B,MAAM;gBACNC,KAAK;gBACLC,iBAAiB;YACnB;SACD;QAED,IAAIJ,EAAAA,yBAAAA,cAAcK,OAAO,qBAArBL,uBAAuBM,MAAM,IAAG,GAAG;YACrC,MAAMnC,uBAAuBC;QAC/B,OAAO;YACL,IAAI;gBACF,MAAMO,yBAAyBqB,eAAeD;YAChD,EAAE,OAAOQ,KAAK;gBACZC,KAAIC,IAAI,CACN,CAAC,wFAAwF,EAAEjC,IAAAA,gBAAI,EAC7FE,IAAAA,gBAAI,EAAC,0BACL,8BAA8B,CAAC;YAErC;QACF;IACF,EAAE,OAAO6B,KAAK;QACZ,8EAA8E;QAC9E,IAAIA,eAAehC,sBAAU,EAAE;YAC7BmC,QAAQC,KAAK,CAACJ,IAAIK,OAAO;YACzBC,QAAQC,IAAI,CAAC;QACf;QACA,MAAMP;IACR;AACF","ignoreList":[0]}
|
@@ -96,7 +96,7 @@ async function verifyTypeScriptSetup({ dir, distDir, cacheDir, intentDirs, tscon
|
|
96
96
|
};
|
97
97
|
}
|
98
98
|
// Ensure TypeScript and necessary `@types/*` are installed:
|
99
|
-
let deps =
|
99
|
+
let deps = (0, _hasnecessarydependencies.hasNecessaryDependencies)(dir, requiredPackages);
|
100
100
|
if (((_deps_missing = deps.missing) == null ? void 0 : _deps_missing.length) > 0) {
|
101
101
|
if (_ciinfo.isCI) {
|
102
102
|
// we don't attempt auto install in CI to avoid side-effects
|
@@ -110,7 +110,7 @@ async function verifyTypeScriptSetup({ dir, distDir, cacheDir, intentDirs, tscon
|
|
110
110
|
}
|
111
111
|
throw err;
|
112
112
|
});
|
113
|
-
deps =
|
113
|
+
deps = (0, _hasnecessarydependencies.hasNecessaryDependencies)(dir, requiredPackages);
|
114
114
|
}
|
115
115
|
// Load TypeScript after we're sure it exists:
|
116
116
|
const tsPath = deps.resolved.get('typescript');
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../src/lib/verify-typescript-setup.ts"],"sourcesContent":["import { bold, cyan, red, yellow } from './picocolors'\nimport path from 'path'\n\nimport { hasNecessaryDependencies } from './has-necessary-dependencies'\nimport type { NecessaryDependencies } from './has-necessary-dependencies'\nimport semver from 'next/dist/compiled/semver'\nimport { CompileError } from './compile-error'\nimport * as log from '../build/output/log'\n\nimport { getTypeScriptIntent } from './typescript/getTypeScriptIntent'\nimport type { TypeCheckResult } from './typescript/runTypeCheck'\nimport { writeAppTypeDeclarations } from './typescript/writeAppTypeDeclarations'\nimport { writeConfigurationDefaults } from './typescript/writeConfigurationDefaults'\nimport { installDependencies } from './install-dependencies'\nimport { isCI } from '../server/ci-info'\nimport { missingDepsError } from './typescript/missingDependencyError'\n\nconst requiredPackages = [\n {\n file: 'typescript/lib/typescript.js',\n pkg: 'typescript',\n exportsRestrict: true,\n },\n {\n file: '@types/react/index.d.ts',\n pkg: '@types/react',\n exportsRestrict: true,\n },\n {\n file: '@types/node/index.d.ts',\n pkg: '@types/node',\n exportsRestrict: true,\n },\n]\n\nexport async function verifyTypeScriptSetup({\n dir,\n distDir,\n cacheDir,\n intentDirs,\n tsconfigPath,\n typeCheckPreflight,\n disableStaticImages,\n hasAppDir,\n hasPagesDir,\n}: {\n dir: string\n distDir: string\n cacheDir?: string\n tsconfigPath: string | undefined\n intentDirs: string[]\n typeCheckPreflight: boolean\n disableStaticImages: boolean\n hasAppDir: boolean\n hasPagesDir: boolean\n}): Promise<{ result?: TypeCheckResult; version: string | null }> {\n const tsConfigFileName = tsconfigPath || 'tsconfig.json'\n const resolvedTsConfigPath = path.join(dir, tsConfigFileName)\n\n try {\n // Check if the project uses TypeScript:\n const intent = await getTypeScriptIntent(dir, intentDirs, tsConfigFileName)\n if (!intent) {\n return { version: null }\n }\n\n // Ensure TypeScript and necessary `@types/*` are installed:\n let deps: NecessaryDependencies =
|
1
|
+
{"version":3,"sources":["../../src/lib/verify-typescript-setup.ts"],"sourcesContent":["import { bold, cyan, red, yellow } from './picocolors'\nimport path from 'path'\n\nimport { hasNecessaryDependencies } from './has-necessary-dependencies'\nimport type { NecessaryDependencies } from './has-necessary-dependencies'\nimport semver from 'next/dist/compiled/semver'\nimport { CompileError } from './compile-error'\nimport * as log from '../build/output/log'\n\nimport { getTypeScriptIntent } from './typescript/getTypeScriptIntent'\nimport type { TypeCheckResult } from './typescript/runTypeCheck'\nimport { writeAppTypeDeclarations } from './typescript/writeAppTypeDeclarations'\nimport { writeConfigurationDefaults } from './typescript/writeConfigurationDefaults'\nimport { installDependencies } from './install-dependencies'\nimport { isCI } from '../server/ci-info'\nimport { missingDepsError } from './typescript/missingDependencyError'\n\nconst requiredPackages = [\n {\n file: 'typescript/lib/typescript.js',\n pkg: 'typescript',\n exportsRestrict: true,\n },\n {\n file: '@types/react/index.d.ts',\n pkg: '@types/react',\n exportsRestrict: true,\n },\n {\n file: '@types/node/index.d.ts',\n pkg: '@types/node',\n exportsRestrict: true,\n },\n]\n\nexport async function verifyTypeScriptSetup({\n dir,\n distDir,\n cacheDir,\n intentDirs,\n tsconfigPath,\n typeCheckPreflight,\n disableStaticImages,\n hasAppDir,\n hasPagesDir,\n}: {\n dir: string\n distDir: string\n cacheDir?: string\n tsconfigPath: string | undefined\n intentDirs: string[]\n typeCheckPreflight: boolean\n disableStaticImages: boolean\n hasAppDir: boolean\n hasPagesDir: boolean\n}): Promise<{ result?: TypeCheckResult; version: string | null }> {\n const tsConfigFileName = tsconfigPath || 'tsconfig.json'\n const resolvedTsConfigPath = path.join(dir, tsConfigFileName)\n\n try {\n // Check if the project uses TypeScript:\n const intent = await getTypeScriptIntent(dir, intentDirs, tsConfigFileName)\n if (!intent) {\n return { version: null }\n }\n\n // Ensure TypeScript and necessary `@types/*` are installed:\n let deps: NecessaryDependencies = hasNecessaryDependencies(\n dir,\n requiredPackages\n )\n\n if (deps.missing?.length > 0) {\n if (isCI) {\n // we don't attempt auto install in CI to avoid side-effects\n // and instead log the error for installing needed packages\n missingDepsError(dir, deps.missing)\n }\n console.log(\n bold(\n yellow(\n `It looks like you're trying to use TypeScript but do not have the required package(s) installed.`\n )\n ) +\n '\\n' +\n 'Installing dependencies' +\n '\\n\\n' +\n bold(\n 'If you are not trying to use TypeScript, please remove the ' +\n cyan('tsconfig.json') +\n ' file from your package root (and any TypeScript files in your app and pages directories).'\n ) +\n '\\n'\n )\n await installDependencies(dir, deps.missing, true).catch((err) => {\n if (err && typeof err === 'object' && 'command' in err) {\n console.error(\n `Failed to install required TypeScript dependencies, please install them manually to continue:\\n` +\n (err as any).command +\n '\\n'\n )\n }\n throw err\n })\n deps = hasNecessaryDependencies(dir, requiredPackages)\n }\n\n // Load TypeScript after we're sure it exists:\n const tsPath = deps.resolved.get('typescript')!\n const ts = (await Promise.resolve(\n require(tsPath)\n )) as typeof import('typescript')\n\n if (semver.lt(ts.version, '4.5.2')) {\n log.warn(\n `Minimum recommended TypeScript version is v4.5.2, older versions can potentially be incompatible with Next.js. Detected: ${ts.version}`\n )\n }\n\n // Reconfigure (or create) the user's `tsconfig.json` for them:\n await writeConfigurationDefaults(\n ts,\n resolvedTsConfigPath,\n intent.firstTimeSetup,\n hasAppDir,\n distDir,\n hasPagesDir\n )\n // Write out the necessary `next-env.d.ts` file to correctly register\n // Next.js' types:\n await writeAppTypeDeclarations({\n baseDir: dir,\n distDir,\n imageImportsEnabled: !disableStaticImages,\n hasPagesDir,\n hasAppDir,\n })\n\n let result\n if (typeCheckPreflight) {\n const { runTypeCheck } =\n require('./typescript/runTypeCheck') as typeof import('./typescript/runTypeCheck')\n\n // Verify the project passes type-checking before we go to webpack phase:\n result = await runTypeCheck(\n ts,\n dir,\n distDir,\n resolvedTsConfigPath,\n cacheDir,\n hasAppDir\n )\n }\n return { result, version: ts.version }\n } catch (err) {\n // These are special errors that should not show a stack trace:\n if (err instanceof CompileError) {\n console.error(red('Failed to compile.\\n'))\n console.error(err.message)\n process.exit(1)\n }\n\n /**\n * verifyTypeScriptSetup can be either invoked directly in the main thread (during next dev / next lint)\n * or run in a worker (during next build). In the latter case, we need to print the error message, as the\n * parent process will only receive an `Jest worker encountered 1 child process exceptions, exceeding retry limit`.\n */\n\n // we are in a worker, print the error message and exit the process\n if (process.env.IS_NEXT_WORKER) {\n if (err instanceof Error) {\n console.error(err.message)\n } else {\n console.error(err)\n }\n process.exit(1)\n }\n // we are in the main thread, throw the error and it will be handled by the caller\n throw err\n }\n}\n"],"names":["verifyTypeScriptSetup","requiredPackages","file","pkg","exportsRestrict","dir","distDir","cacheDir","intentDirs","tsconfigPath","typeCheckPreflight","disableStaticImages","hasAppDir","hasPagesDir","tsConfigFileName","resolvedTsConfigPath","path","join","deps","intent","getTypeScriptIntent","version","hasNecessaryDependencies","missing","length","isCI","missingDepsError","console","log","bold","yellow","cyan","installDependencies","catch","err","error","command","tsPath","resolved","get","ts","Promise","resolve","require","semver","lt","warn","writeConfigurationDefaults","firstTimeSetup","writeAppTypeDeclarations","baseDir","imageImportsEnabled","result","runTypeCheck","CompileError","red","message","process","exit","env","IS_NEXT_WORKER","Error"],"mappings":";;;;+BAmCsBA;;;eAAAA;;;4BAnCkB;6DACvB;0CAEwB;+DAEtB;8BACU;6DACR;qCAEe;0CAEK;4CACE;qCACP;wBACf;wCACY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEjC,MAAMC,mBAAmB;IACvB;QACEC,MAAM;QACNC,KAAK;QACLC,iBAAiB;IACnB;IACA;QACEF,MAAM;QACNC,KAAK;QACLC,iBAAiB;IACnB;IACA;QACEF,MAAM;QACNC,KAAK;QACLC,iBAAiB;IACnB;CACD;AAEM,eAAeJ,sBAAsB,EAC1CK,GAAG,EACHC,OAAO,EACPC,QAAQ,EACRC,UAAU,EACVC,YAAY,EACZC,kBAAkB,EAClBC,mBAAmB,EACnBC,SAAS,EACTC,WAAW,EAWZ;IACC,MAAMC,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AE5I;QAEA,+DAA+D;QAC/D,MAAM0B,IAAAA,sDAA0B,EAC9BP,IACAzB,sBACAI,OAAO6B,cAAc,EACrBpC,WACAN,SACAO;QAEF,qEAAqE;QACrE,kBAAkB;QAClB,MAAMoC,IAAAA,kDAAwB,EAAC;YAC7BC,SAAS7C;YACTC;YACA6C,qBAAqB,CAACxC;YACtBE;YACAD;QACF;QAEA,IAAIwC;QACJ,IAAI1C,oBAAoB;YACtB,MAAM,EAAE2C,YAAY,EAAE,GACpBV,QAAQ;YAEV,yEAAyE;YACzES,SAAS,MAAMC,aACbb,IACAnC,KACAC,SACAS,sBACAR,UACAK;QAEJ;QACA,OAAO;YAAEwC;YAAQ/B,SAASmB,GAAGnB,OAAO;QAAC;IACvC,EAAE,OAAOa,KAAK;QACZ,+DAA+D;QAC/D,IAAIA,eAAeoB,0BAAY,EAAE;YAC/B3B,QAAQQ,KAAK,CAACoB,IAAAA,eAAG,EAAC;YAClB5B,QAAQQ,KAAK,CAACD,IAAIsB,OAAO;YACzBC,QAAQC,IAAI,CAAC;QACf;QAEA;;;;KAIC,GAED,mEAAmE;QACnE,IAAID,QAAQE,GAAG,CAACC,cAAc,EAAE;YAC9B,IAAI1B,eAAe2B,OAAO;gBACxBlC,QAAQQ,KAAK,CAACD,IAAIsB,OAAO;YAC3B,OAAO;gBACL7B,QAAQQ,KAAK,CAACD;YAChB;YACAuB,QAAQC,IAAI,CAAC;QACf;QACA,kFAAkF;QAClF,MAAMxB;IACR;AACF","ignoreList":[0]}
|
@@ -146,7 +146,7 @@ async function createHotReloaderTurbopack(opts, serverFields, distDir, resetFetc
|
|
146
146
|
}
|
147
147
|
const hasRewrites = opts.fsChecker.rewrites.afterFiles.length > 0 || opts.fsChecker.rewrites.beforeFiles.length > 0 || opts.fsChecker.rewrites.fallback.length > 0;
|
148
148
|
const hotReloaderSpan = (0, _trace.trace)('hot-reloader', undefined, {
|
149
|
-
version: "15.5.1-canary.
|
149
|
+
version: "15.5.1-canary.34"
|
150
150
|
});
|
151
151
|
// Ensure the hotReloaderSpan is flushed immediately as it's the parentSpan for all processing
|
152
152
|
// of the current `next dev` invocation.
|
@@ -533,7 +533,17 @@ async function createHotReloaderTurbopack(opts, serverFields, distDir, resetFetc
|
|
533
533
|
}
|
534
534
|
})
|
535
535
|
];
|
536
|
-
|
536
|
+
let versionInfoCached;
|
537
|
+
// This fetch, even though not awaited, is not kicked off eagerly because the first `fetch()` in
|
538
|
+
// Node.js adds roughly 20ms main-thread blocking to load the SSL certificate cache
|
539
|
+
// We don't want that blocking time to be in the hot path for the `ready in` logging.
|
540
|
+
// Instead, the fetch is kicked off lazily when the first `getVersionInfoCached()` is called.
|
541
|
+
const getVersionInfoCached = ()=>{
|
542
|
+
if (!versionInfoCached) {
|
543
|
+
versionInfoCached = (0, _hotreloaderwebpack.getVersionInfo)();
|
544
|
+
}
|
545
|
+
return versionInfoCached;
|
546
|
+
};
|
537
547
|
let devtoolsFrontendUrl;
|
538
548
|
const nodeDebugType = (0, _utils2.getNodeDebugType)();
|
539
549
|
if (nodeDebugType) {
|
@@ -715,7 +725,7 @@ async function createHotReloaderTurbopack(opts, serverFields, distDir, resetFetc
|
|
715
725
|
}
|
716
726
|
;
|
717
727
|
(async function() {
|
718
|
-
const versionInfo = await
|
728
|
+
const versionInfo = await getVersionInfoCached();
|
719
729
|
const devToolsConfig = await (0, _devtoolsconfigmiddleware.getDevToolsConfig)(distDir);
|
720
730
|
const syncMessage = {
|
721
731
|
type: _hotreloadertypes.HMR_MESSAGE_SENT_TO_BROWSER.SYNC,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/server/dev/hot-reloader-turbopack.ts"],"sourcesContent":["import type { Socket } from 'net'\nimport { mkdir, writeFile } from 'fs/promises'\nimport { join, extname, relative } from 'path'\nimport { pathToFileURL } from 'url'\n\nimport ws from 'next/dist/compiled/ws'\n\nimport type { OutputState } from '../../build/output/store'\nimport { store as consoleStore } from '../../build/output/store'\nimport type {\n CompilationError,\n HmrMessageSentToBrowser,\n NextJsHotReloaderInterface,\n ReloadPageMessage,\n SyncMessage,\n TurbopackConnectedMessage,\n} from './hot-reloader-types'\nimport { HMR_MESSAGE_SENT_TO_BROWSER } from './hot-reloader-types'\nimport type {\n Update as TurbopackUpdate,\n Endpoint,\n WrittenEndpoint,\n TurbopackResult,\n Project,\n Entrypoints,\n} from '../../build/swc/types'\nimport { createDefineEnv } from '../../build/swc'\nimport * as Log from '../../build/output/log'\nimport {\n getVersionInfo,\n matchNextPageBundleRequest,\n} from './hot-reloader-webpack'\nimport { BLOCKED_PAGES } from '../../shared/lib/constants'\nimport {\n getOverlayMiddleware,\n getSourceMapMiddleware,\n} from './middleware-turbopack'\nimport { PageNotFoundError } from '../../shared/lib/utils'\nimport { debounce } from '../utils'\nimport { deleteCache } from './require-cache'\nimport {\n clearAllModuleContexts,\n clearModuleContext,\n} from '../lib/render-server'\nimport { denormalizePagePath } from '../../shared/lib/page-path/denormalize-page-path'\nimport { trace } from '../../trace'\nimport {\n AssetMapper,\n type ChangeSubscriptions,\n type ClientState,\n handleEntrypoints,\n handlePagesErrorRoute,\n handleRouteType,\n hasEntrypointForKey,\n msToNs,\n type ReadyIds,\n type SendHmr,\n type StartBuilding,\n processTopLevelIssues,\n printNonFatalIssue,\n normalizedPageToTurbopackStructureRoute,\n} from './turbopack-utils'\nimport {\n propagateServerField,\n type ServerFields,\n type SetupOpts,\n} from '../lib/router-utils/setup-dev-bundler'\nimport { TurbopackManifestLoader } from '../../shared/lib/turbopack/manifest-loader'\nimport { findPagePathData } from './on-demand-entry-handler'\nimport type { RouteDefinition } from '../route-definitions/route-definition'\nimport {\n type EntryKey,\n getEntryKey,\n splitEntryKey,\n} from '../../shared/lib/turbopack/entry-key'\nimport {\n createBinaryHmrMessageData,\n FAST_REFRESH_RUNTIME_RELOAD,\n} from './messages'\nimport { generateEncryptionKeyBase64 } from '../app-render/encryption-utils-server'\nimport { isAppPageRouteDefinition } from '../route-definitions/app-page-route-definition'\nimport { normalizeAppPath } from '../../shared/lib/router/utils/app-paths'\nimport type { ModernSourceMapPayload } from '../lib/source-maps'\nimport { getNodeDebugType } from '../lib/utils'\nimport { isMetadataRouteFile } from '../../lib/metadata/is-metadata-route'\nimport { setBundlerFindSourceMapImplementation } from '../patch-error-inspect'\nimport { getNextErrorFeedbackMiddleware } from '../../next-devtools/server/get-next-error-feedback-middleware'\nimport {\n formatIssue,\n isPersistentCachingEnabled,\n isWellKnownError,\n processIssues,\n renderStyledStringToErrorAnsi,\n type EntryIssuesMap,\n type TopLevelIssuesMap,\n} from '../../shared/lib/turbopack/utils'\nimport { getDevOverlayFontMiddleware } from '../../next-devtools/server/font/get-dev-overlay-font-middleware'\nimport { devIndicatorServerState } from './dev-indicator-server-state'\nimport { getDisableDevIndicatorMiddleware } from '../../next-devtools/server/dev-indicator-middleware'\nimport { getRestartDevServerMiddleware } from '../../next-devtools/server/restart-dev-server-middleware'\nimport { backgroundLogCompilationEvents } from '../../shared/lib/turbopack/compilation-events'\nimport { getSupportedBrowsers } from '../../build/utils'\nimport { receiveBrowserLogsTurbopack } from './browser-logs/receive-logs'\nimport { normalizePath } from '../../lib/normalize-path'\nimport {\n devToolsConfigMiddleware,\n getDevToolsConfig,\n} from '../../next-devtools/server/devtools-config-middleware'\nimport {\n connectReactDebugChannel,\n deleteReactDebugChannel,\n setReactDebugChannel,\n} from './debug-channel'\n\nconst wsServer = new ws.Server({ noServer: true })\nconst isTestMode = !!(\n process.env.NEXT_TEST_MODE ||\n process.env.__NEXT_TEST_MODE ||\n process.env.DEBUG\n)\n\nconst sessionId = Math.floor(Number.MAX_SAFE_INTEGER * Math.random())\n\ndeclare const __next__clear_chunk_cache__: (() => void) | null | undefined\n\n/**\n * Replaces turbopack:///[project] with the specified project in the `source` field.\n */\nfunction rewriteTurbopackSources(\n projectRoot: string,\n sourceMap: ModernSourceMapPayload\n): void {\n if ('sections' in sourceMap) {\n for (const section of sourceMap.sections) {\n rewriteTurbopackSources(projectRoot, section.map)\n }\n } else {\n for (let i = 0; i < sourceMap.sources.length; i++) {\n sourceMap.sources[i] = pathToFileURL(\n join(\n projectRoot,\n sourceMap.sources[i].replace(/turbopack:\\/\\/\\/\\[project\\]/, '')\n )\n ).toString()\n }\n }\n}\n\nfunction getSourceMapFromTurbopack(\n project: Project,\n projectRoot: string,\n sourceURL: string\n): ModernSourceMapPayload | undefined {\n let sourceMapJson: string | null = null\n\n try {\n sourceMapJson = project.getSourceMapSync(sourceURL)\n } catch (err) {}\n\n if (sourceMapJson === null) {\n return undefined\n } else {\n const payload: ModernSourceMapPayload = JSON.parse(sourceMapJson)\n // The sourcemap from Turbopack is not yet written to disk so its `sources`\n // are not absolute paths yet. We need to rewrite them to be absolute paths.\n rewriteTurbopackSources(projectRoot, payload)\n return payload\n }\n}\n\nexport async function createHotReloaderTurbopack(\n opts: SetupOpts & { isSrcDir: boolean },\n serverFields: ServerFields,\n distDir: string,\n resetFetch: () => void\n): Promise<NextJsHotReloaderInterface> {\n const dev = true\n const buildId = 'development'\n const { nextConfig, dir: projectPath } = opts\n\n const { loadBindings } =\n require('../../build/swc') as typeof import('../../build/swc')\n\n let bindings = await loadBindings()\n\n // For the debugging purpose, check if createNext or equivalent next instance setup in test cases\n // works correctly. Normally `run-test` hides output so only will be visible when `--debug` flag is used.\n if (isTestMode) {\n ;(require('console') as typeof import('console')).log(\n 'Creating turbopack project',\n {\n dir: projectPath,\n testMode: isTestMode,\n }\n )\n }\n\n const hasRewrites =\n opts.fsChecker.rewrites.afterFiles.length > 0 ||\n opts.fsChecker.rewrites.beforeFiles.length > 0 ||\n opts.fsChecker.rewrites.fallback.length > 0\n\n const hotReloaderSpan = trace('hot-reloader', undefined, {\n version: process.env.__NEXT_VERSION as string,\n })\n // Ensure the hotReloaderSpan is flushed immediately as it's the parentSpan for all processing\n // of the current `next dev` invocation.\n hotReloaderSpan.stop()\n\n const encryptionKey = await generateEncryptionKeyBase64({\n isBuild: false,\n distDir,\n })\n\n // TODO: Implement\n let clientRouterFilters: any\n if (nextConfig.experimental.clientRouterFilter) {\n // TODO this need to be set correctly for persistent caching to work\n }\n\n const supportedBrowsers = getSupportedBrowsers(projectPath, dev)\n const currentNodeJsVersion = process.versions.node\n\n const rootPath =\n opts.nextConfig.turbopack?.root ||\n opts.nextConfig.outputFileTracingRoot ||\n projectPath\n const project = await bindings.turbo.createProject(\n {\n rootPath,\n projectPath: normalizePath(relative(rootPath, projectPath) || '.'),\n distDir,\n nextConfig: opts.nextConfig,\n watch: {\n enable: dev,\n pollIntervalMs: nextConfig.watchOptions?.pollIntervalMs,\n },\n dev,\n env: process.env as Record<string, string>,\n defineEnv: createDefineEnv({\n isTurbopack: true,\n clientRouterFilters,\n config: nextConfig,\n dev,\n distDir,\n projectPath,\n fetchCacheKeyPrefix: opts.nextConfig.experimental.fetchCacheKeyPrefix,\n hasRewrites,\n // TODO: Implement\n middlewareMatchers: undefined,\n rewrites: opts.fsChecker.rewrites,\n }),\n buildId,\n encryptionKey,\n previewProps: opts.fsChecker.prerenderManifest.preview,\n browserslistQuery: supportedBrowsers.join(', '),\n noMangling: false,\n currentNodeJsVersion,\n },\n {\n persistentCaching: isPersistentCachingEnabled(opts.nextConfig),\n memoryLimit: opts.nextConfig.experimental?.turbopackMemoryLimit,\n isShortSession: false,\n }\n )\n backgroundLogCompilationEvents(project, {\n eventTypes: ['StartupCacheInvalidationEvent', 'TimingEvent'],\n })\n setBundlerFindSourceMapImplementation(\n getSourceMapFromTurbopack.bind(null, project, projectPath)\n )\n opts.onDevServerCleanup?.(async () => {\n setBundlerFindSourceMapImplementation(() => undefined)\n await project.onExit()\n })\n const entrypointsSubscription = project.entrypointsSubscribe()\n\n const currentWrittenEntrypoints: Map<EntryKey, WrittenEndpoint> = new Map()\n const currentEntrypoints: Entrypoints = {\n global: {\n app: undefined,\n document: undefined,\n error: undefined,\n\n middleware: undefined,\n instrumentation: undefined,\n },\n\n page: new Map(),\n app: new Map(),\n }\n\n const currentTopLevelIssues: TopLevelIssuesMap = new Map()\n const currentEntryIssues: EntryIssuesMap = new Map()\n\n const manifestLoader = new TurbopackManifestLoader({\n buildId,\n distDir,\n encryptionKey,\n })\n\n // Dev specific\n const changeSubscriptions: ChangeSubscriptions = new Map()\n const serverPathState = new Map<string, string>()\n const readyIds: ReadyIds = new Set()\n let currentEntriesHandlingResolve: ((value?: unknown) => void) | undefined\n let currentEntriesHandling = new Promise(\n (resolve) => (currentEntriesHandlingResolve = resolve)\n )\n\n const assetMapper = new AssetMapper()\n\n function clearRequireCache(\n key: EntryKey,\n writtenEndpoint: WrittenEndpoint,\n {\n force,\n }: {\n // Always clear the cache, don't check if files have changed\n force?: boolean\n } = {}\n ): boolean {\n if (force) {\n for (const { path, contentHash } of writtenEndpoint.serverPaths) {\n // We ignore source maps\n if (path.endsWith('.map')) continue\n const localKey = `${key}:${path}`\n serverPathState.set(localKey, contentHash)\n serverPathState.set(path, contentHash)\n }\n } else {\n // Figure out if the server files have changed\n let hasChange = false\n for (const { path, contentHash } of writtenEndpoint.serverPaths) {\n // We ignore source maps\n if (path.endsWith('.map')) continue\n const localKey = `${key}:${path}`\n const localHash = serverPathState.get(localKey)\n const globalHash = serverPathState.get(path)\n if (\n (localHash && localHash !== contentHash) ||\n (globalHash && globalHash !== contentHash)\n ) {\n hasChange = true\n serverPathState.set(localKey, contentHash)\n serverPathState.set(path, contentHash)\n } else {\n if (!localHash) {\n serverPathState.set(localKey, contentHash)\n }\n if (!globalHash) {\n serverPathState.set(path, contentHash)\n }\n }\n }\n\n if (!hasChange) {\n return false\n }\n }\n\n resetFetch()\n\n // Not available in:\n // - Pages Router (no server-side HMR)\n // - Edge Runtime (uses browser runtime which already disposes chunks individually)\n if (typeof __next__clear_chunk_cache__ === 'function') {\n __next__clear_chunk_cache__()\n }\n\n const serverPaths = writtenEndpoint.serverPaths.map(({ path: p }) =>\n join(distDir, p)\n )\n\n for (const file of serverPaths) {\n clearModuleContext(file)\n deleteCache(file)\n }\n\n return true\n }\n\n const buildingIds = new Set()\n\n const startBuilding: StartBuilding = (id, requestUrl, forceRebuild) => {\n if (!forceRebuild && readyIds.has(id)) {\n return () => {}\n }\n if (buildingIds.size === 0) {\n consoleStore.setState(\n {\n loading: true,\n trigger: id,\n url: requestUrl,\n } as OutputState,\n true\n )\n }\n buildingIds.add(id)\n return function finishBuilding() {\n if (buildingIds.size === 0) {\n return\n }\n readyIds.add(id)\n buildingIds.delete(id)\n if (buildingIds.size === 0) {\n hmrEventHappened = false\n consoleStore.setState(\n {\n loading: false,\n } as OutputState,\n true\n )\n }\n }\n }\n\n let hmrEventHappened = false\n let hmrHash = 0\n\n const clients = new Set<ws>()\n const clientsByRequestId = new Map<string, ws>()\n const clientStates = new WeakMap<ws, ClientState>()\n\n function sendToClient(client: ws, message: HmrMessageSentToBrowser) {\n const data =\n typeof message.type === 'number'\n ? createBinaryHmrMessageData(message)\n : JSON.stringify(message)\n\n client.send(data)\n }\n\n function sendEnqueuedMessages() {\n for (const [, issueMap] of currentEntryIssues) {\n if (\n [...issueMap.values()].filter((i) => i.severity !== 'warning').length >\n 0\n ) {\n // During compilation errors we want to delay the HMR events until errors are fixed\n return\n }\n }\n\n for (const client of clients) {\n const state = clientStates.get(client)\n if (!state) {\n continue\n }\n\n for (const [, issueMap] of state.clientIssues) {\n if (\n [...issueMap.values()].filter((i) => i.severity !== 'warning')\n .length > 0\n ) {\n // During compilation errors we want to delay the HMR events until errors are fixed\n return\n }\n }\n\n for (const message of state.messages.values()) {\n sendToClient(client, message)\n }\n state.messages.clear()\n\n if (state.turbopackUpdates.length > 0) {\n sendToClient(client, {\n type: HMR_MESSAGE_SENT_TO_BROWSER.TURBOPACK_MESSAGE,\n data: state.turbopackUpdates,\n })\n state.turbopackUpdates.length = 0\n }\n }\n }\n const sendEnqueuedMessagesDebounce = debounce(sendEnqueuedMessages, 2)\n\n const sendHmr: SendHmr = (id: string, message: HmrMessageSentToBrowser) => {\n for (const client of clients) {\n clientStates.get(client)?.messages.set(id, message)\n }\n\n hmrEventHappened = true\n sendEnqueuedMessagesDebounce()\n }\n\n function sendTurbopackMessage(payload: TurbopackUpdate) {\n // TODO(PACK-2049): For some reason we end up emitting hundreds of issues messages on bigger apps,\n // a lot of which are duplicates.\n // They are currently not handled on the client at all, so might as well not send them for now.\n payload.diagnostics = []\n payload.issues = []\n\n for (const client of clients) {\n clientStates.get(client)?.turbopackUpdates.push(payload)\n }\n\n hmrEventHappened = true\n sendEnqueuedMessagesDebounce()\n }\n\n async function subscribeToChanges(\n key: EntryKey,\n includeIssues: boolean,\n endpoint: Endpoint,\n createMessage: (\n change: TurbopackResult,\n hash: string\n ) => Promise<HmrMessageSentToBrowser> | HmrMessageSentToBrowser | void,\n onError?: (\n error: Error\n ) => Promise<HmrMessageSentToBrowser> | HmrMessageSentToBrowser | void\n ) {\n if (changeSubscriptions.has(key)) {\n return\n }\n\n const { side } = splitEntryKey(key)\n\n const changedPromise = endpoint[`${side}Changed`](includeIssues)\n changeSubscriptions.set(key, changedPromise)\n try {\n const changed = await changedPromise\n\n for await (const change of changed) {\n processIssues(currentEntryIssues, key, change, false, true)\n // TODO: Get an actual content hash from Turbopack.\n const message = await createMessage(change, String(++hmrHash))\n if (message) {\n sendHmr(key, message)\n }\n }\n } catch (e) {\n changeSubscriptions.delete(key)\n const payload = await onError?.(e as Error)\n if (payload) {\n sendHmr(key, payload)\n }\n return\n }\n changeSubscriptions.delete(key)\n }\n\n async function unsubscribeFromChanges(key: EntryKey) {\n const subscription = await changeSubscriptions.get(key)\n if (subscription) {\n await subscription.return?.()\n changeSubscriptions.delete(key)\n }\n currentEntryIssues.delete(key)\n }\n\n async function subscribeToHmrEvents(client: ws, id: string) {\n const key = getEntryKey('assets', 'client', id)\n if (!hasEntrypointForKey(currentEntrypoints, key, assetMapper)) {\n // maybe throw an error / force the client to reload?\n return\n }\n\n const state = clientStates.get(client)\n if (!state || state.subscriptions.has(id)) {\n return\n }\n\n const subscription = project!.hmrEvents(id)\n state.subscriptions.set(id, subscription)\n\n // The subscription will always emit once, which is the initial\n // computation. This is not a change, so swallow it.\n try {\n await subscription.next()\n\n for await (const data of subscription) {\n processIssues(state.clientIssues, key, data, false, true)\n if (data.type !== 'issues') {\n sendTurbopackMessage(data)\n }\n }\n } catch (e) {\n // The client might be using an HMR session from a previous server, tell them\n // to fully reload the page to resolve the issue. We can't use\n // `hotReloader.send` since that would force every connected client to\n // reload, only this client is out of date.\n const reloadMessage: ReloadPageMessage = {\n type: HMR_MESSAGE_SENT_TO_BROWSER.RELOAD_PAGE,\n data: `error in HMR event subscription for ${id}: ${e}`,\n }\n sendToClient(client, reloadMessage)\n client.close()\n return\n }\n }\n\n function unsubscribeFromHmrEvents(client: ws, id: string) {\n const state = clientStates.get(client)\n if (!state) {\n return\n }\n\n const subscription = state.subscriptions.get(id)\n subscription?.return!()\n\n const key = getEntryKey('assets', 'client', id)\n state.clientIssues.delete(key)\n }\n\n async function handleEntrypointsSubscription() {\n for await (const entrypoints of entrypointsSubscription) {\n if (!currentEntriesHandlingResolve) {\n currentEntriesHandling = new Promise(\n // eslint-disable-next-line no-loop-func\n (resolve) => (currentEntriesHandlingResolve = resolve)\n )\n }\n\n processTopLevelIssues(currentTopLevelIssues, entrypoints)\n\n await handleEntrypoints({\n entrypoints,\n\n currentEntrypoints,\n\n currentEntryIssues,\n manifestLoader,\n devRewrites: opts.fsChecker.rewrites,\n productionRewrites: undefined,\n logErrors: true,\n\n dev: {\n assetMapper,\n changeSubscriptions,\n clients,\n clientStates,\n serverFields,\n\n hooks: {\n handleWrittenEndpoint: (id, result, forceDeleteCache) => {\n currentWrittenEntrypoints.set(id, result)\n return clearRequireCache(id, result, { force: forceDeleteCache })\n },\n propagateServerField: propagateServerField.bind(null, opts),\n sendHmr,\n startBuilding,\n subscribeToChanges,\n unsubscribeFromChanges,\n unsubscribeFromHmrEvents,\n },\n },\n })\n\n currentEntriesHandlingResolve!()\n currentEntriesHandlingResolve = undefined\n }\n }\n\n await mkdir(join(distDir, 'server'), { recursive: true })\n await mkdir(join(distDir, 'static', buildId), { recursive: true })\n await writeFile(\n join(distDir, 'package.json'),\n JSON.stringify(\n {\n type: 'commonjs',\n },\n null,\n 2\n )\n )\n\n const middlewares = [\n getOverlayMiddleware({\n project,\n projectPath,\n isSrcDir: opts.isSrcDir,\n }),\n getSourceMapMiddleware(project),\n getNextErrorFeedbackMiddleware(opts.telemetry),\n getDevOverlayFontMiddleware(),\n getDisableDevIndicatorMiddleware(),\n getRestartDevServerMiddleware({\n telemetry: opts.telemetry,\n turbopackProject: project,\n }),\n devToolsConfigMiddleware({\n distDir,\n sendUpdateSignal: (data) => {\n hotReloader.send({\n type: HMR_MESSAGE_SENT_TO_BROWSER.DEVTOOLS_CONFIG,\n data,\n })\n },\n }),\n ]\n\n const versionInfoPromise = getVersionInfo()\n\n let devtoolsFrontendUrl: string | undefined\n const nodeDebugType = getNodeDebugType()\n if (nodeDebugType) {\n const debugPort = process.debugPort\n let debugInfo\n try {\n // It requires to use 127.0.0.1 instead of localhost for server-side fetching.\n const debugInfoList = await fetch(\n `http://127.0.0.1:${debugPort}/json/list`\n ).then((res) => res.json())\n debugInfo = debugInfoList[0]\n } catch {}\n if (debugInfo) {\n devtoolsFrontendUrl = debugInfo.devtoolsFrontendUrl\n }\n }\n\n const hotReloader: NextJsHotReloaderInterface = {\n turbopackProject: project,\n activeWebpackConfigs: undefined,\n serverStats: null,\n edgeServerStats: null,\n async run(req, res, _parsedUrl) {\n // intercept page chunks request and ensure them with turbopack\n if (req.url?.startsWith('/_next/static/chunks/pages/')) {\n const params = matchNextPageBundleRequest(req.url)\n\n if (params) {\n const decodedPagePath = `/${params.path\n .map((param: string) => decodeURIComponent(param))\n .join('/')}`\n\n const denormalizedPagePath = denormalizePagePath(decodedPagePath)\n\n await hotReloader\n .ensurePage({\n page: denormalizedPagePath,\n clientOnly: false,\n definition: undefined,\n url: req.url,\n })\n .catch(console.error)\n }\n }\n\n for (const middleware of middlewares) {\n let calledNext = false\n\n await middleware(req, res, () => {\n calledNext = true\n })\n\n if (!calledNext) {\n return { finished: true }\n }\n }\n\n // Request was not finished.\n return { finished: undefined }\n },\n\n // TODO: Figure out if socket type can match the NextJsHotReloaderInterface\n onHMR(req, socket: Socket, head, onUpgrade) {\n wsServer.handleUpgrade(req, socket, head, (client) => {\n onUpgrade(client)\n const clientIssues: EntryIssuesMap = new Map()\n const subscriptions: Map<string, AsyncIterator<any>> = new Map()\n\n clients.add(client)\n\n const requestId = req.url\n ? new URL(req.url, 'http://n').searchParams.get('id')\n : null\n\n if (requestId) {\n clientsByRequestId.set(requestId, client)\n }\n\n clientStates.set(client, {\n clientIssues,\n messages: new Map(),\n turbopackUpdates: [],\n subscriptions,\n })\n\n client.on('close', () => {\n // Remove active subscriptions\n for (const subscription of subscriptions.values()) {\n subscription.return?.()\n }\n clientStates.delete(client)\n clients.delete(client)\n\n if (requestId) {\n clientsByRequestId.delete(requestId)\n deleteReactDebugChannel(requestId)\n }\n })\n\n client.addEventListener('message', async ({ data }) => {\n const parsedData = JSON.parse(\n typeof data !== 'string' ? data.toString() : data\n )\n\n // Next.js messages\n switch (parsedData.event) {\n case 'span-end': {\n hotReloaderSpan.manualTraceChild(\n parsedData.spanName,\n msToNs(parsedData.startTime),\n msToNs(parsedData.endTime),\n parsedData.attributes\n )\n break\n }\n case 'client-hmr-latency': // { id, startTime, endTime, page, updatedModules, isPageHidden }\n hotReloaderSpan.manualTraceChild(\n parsedData.event,\n msToNs(parsedData.startTime),\n msToNs(parsedData.endTime),\n {\n updatedModules: parsedData.updatedModules,\n page: parsedData.page,\n isPageHidden: parsedData.isPageHidden,\n }\n )\n break\n\n case 'client-error': // { errorCount, clientId }\n case 'client-warning': // { warningCount, clientId }\n case 'client-success': // { clientId }\n case 'server-component-reload-page': // { clientId }\n case 'client-reload-page': // { clientId }\n case 'client-removed-page': // { page }\n case 'client-full-reload': // { stackTrace, hadRuntimeError }\n const { hadRuntimeError, dependencyChain } = parsedData\n if (hadRuntimeError) {\n Log.warn(FAST_REFRESH_RUNTIME_RELOAD)\n }\n if (\n Array.isArray(dependencyChain) &&\n typeof dependencyChain[0] === 'string'\n ) {\n const cleanedModulePath = dependencyChain[0]\n .replace(/^\\[project\\]/, '.')\n .replace(/ \\[.*\\] \\(.*\\)$/, '')\n Log.warn(\n `Fast Refresh had to perform a full reload when ${cleanedModulePath} changed. Read more: https://nextjs.org/docs/messages/fast-refresh-reload`\n )\n }\n break\n case 'client-added-page':\n // TODO\n break\n case 'browser-logs': {\n if (nextConfig.experimental.browserDebugInfoInTerminal) {\n await receiveBrowserLogsTurbopack({\n entries: parsedData.entries,\n router: parsedData.router,\n sourceType: parsedData.sourceType,\n project,\n projectPath,\n distDir,\n config: nextConfig.experimental.browserDebugInfoInTerminal,\n })\n }\n break\n }\n\n default:\n // Might be a Turbopack message...\n if (!parsedData.type) {\n throw new Error(`unrecognized HMR message \"${data}\"`)\n }\n }\n\n // Turbopack messages\n switch (parsedData.type) {\n case 'turbopack-subscribe':\n subscribeToHmrEvents(client, parsedData.path)\n break\n\n case 'turbopack-unsubscribe':\n unsubscribeFromHmrEvents(client, parsedData.path)\n break\n\n default:\n if (!parsedData.event) {\n throw new Error(`unrecognized Turbopack HMR message \"${data}\"`)\n }\n }\n })\n\n const turbopackConnectedMessage: TurbopackConnectedMessage = {\n type: HMR_MESSAGE_SENT_TO_BROWSER.TURBOPACK_CONNECTED,\n data: { sessionId },\n }\n sendToClient(client, turbopackConnectedMessage)\n\n const errors: CompilationError[] = []\n\n for (const entryIssues of currentEntryIssues.values()) {\n for (const issue of entryIssues.values()) {\n if (issue.severity !== 'warning') {\n errors.push({\n message: formatIssue(issue),\n })\n } else {\n printNonFatalIssue(issue)\n }\n }\n }\n\n if (devIndicatorServerState.disabledUntil < Date.now()) {\n devIndicatorServerState.disabledUntil = 0\n }\n\n ;(async function () {\n const versionInfo = await versionInfoPromise\n const devToolsConfig = await getDevToolsConfig(distDir)\n\n const syncMessage: SyncMessage = {\n type: HMR_MESSAGE_SENT_TO_BROWSER.SYNC,\n errors,\n warnings: [],\n hash: '',\n versionInfo,\n debug: {\n devtoolsFrontendUrl,\n },\n devIndicator: devIndicatorServerState,\n devToolsConfig,\n }\n\n sendToClient(client, syncMessage)\n\n if (requestId) {\n connectReactDebugChannel(requestId, sendToClient.bind(null, client))\n }\n })()\n })\n },\n\n send(action) {\n const payload = JSON.stringify(action)\n\n for (const client of clients) {\n client.send(payload)\n }\n },\n\n setReactDebugChannel(debugChannel, htmlRequestId, requestId) {\n // Store the debug channel, regardless of whether the client is connected.\n setReactDebugChannel(requestId, debugChannel)\n\n // If the client is connected, we can connect the debug channel\n // immediately. Otherwise, we'll do that when the client connects.\n const client = clientsByRequestId.get(htmlRequestId)\n\n if (client) {\n connectReactDebugChannel(requestId, sendToClient.bind(null, client))\n }\n },\n\n setHmrServerError(_error) {\n // Not implemented yet.\n },\n clearHmrServerError() {\n // Not implemented yet.\n },\n async start() {},\n async getCompilationErrors(page) {\n const appEntryKey = getEntryKey('app', 'server', page)\n const pagesEntryKey = getEntryKey('pages', 'server', page)\n\n const topLevelIssues = currentTopLevelIssues.values()\n\n const thisEntryIssues =\n currentEntryIssues.get(appEntryKey) ??\n currentEntryIssues.get(pagesEntryKey)\n\n if (thisEntryIssues !== undefined && thisEntryIssues.size > 0) {\n // If there is an error related to the requesting page we display it instead of the first error\n return [...topLevelIssues, ...thisEntryIssues.values()]\n .map((issue) => {\n const formattedIssue = formatIssue(issue)\n if (issue.severity === 'warning') {\n printNonFatalIssue(issue)\n return null\n } else if (isWellKnownError(issue)) {\n Log.error(formattedIssue)\n }\n\n return new Error(formattedIssue)\n })\n .filter((error) => error !== null)\n }\n\n // Otherwise, return all errors across pages\n const errors = []\n for (const issue of topLevelIssues) {\n if (issue.severity !== 'warning') {\n errors.push(new Error(formatIssue(issue)))\n }\n }\n for (const entryIssues of currentEntryIssues.values()) {\n for (const issue of entryIssues.values()) {\n if (issue.severity !== 'warning') {\n const message = formatIssue(issue)\n errors.push(new Error(message))\n } else {\n printNonFatalIssue(issue)\n }\n }\n }\n return errors\n },\n async invalidate({\n // .env files or tsconfig/jsconfig change\n reloadAfterInvalidation,\n }) {\n if (reloadAfterInvalidation) {\n for (const [key, entrypoint] of currentWrittenEntrypoints) {\n clearRequireCache(key, entrypoint, { force: true })\n }\n\n await clearAllModuleContexts()\n this.send({\n type: HMR_MESSAGE_SENT_TO_BROWSER.SERVER_COMPONENT_CHANGES,\n hash: String(++hmrHash),\n })\n }\n },\n async buildFallbackError() {\n // Not implemented yet.\n },\n async ensurePage({\n page: inputPage,\n // Unused parameters\n // clientOnly,\n appPaths,\n definition,\n isApp,\n url: requestUrl,\n }) {\n // When there is no route definition this is an internal file not a route the user added.\n // Middleware and instrumentation are handled in turbpack-utils.ts handleEntrypoints instead.\n if (!definition) {\n if (inputPage === '/middleware') return\n if (inputPage === '/src/middleware') return\n if (inputPage === '/instrumentation') return\n if (inputPage === '/src/instrumentation') return\n }\n\n return hotReloaderSpan\n .traceChild('ensure-page', {\n inputPage,\n })\n .traceAsyncFn(async () => {\n if (BLOCKED_PAGES.includes(inputPage) && inputPage !== '/_error') {\n return\n }\n\n await currentEntriesHandling\n\n // TODO We shouldn't look into the filesystem again. This should use the information from entrypoints\n let routeDef: Pick<\n RouteDefinition,\n 'filename' | 'bundlePath' | 'page'\n > =\n definition ??\n (await findPagePathData(\n projectPath,\n inputPage,\n nextConfig.pageExtensions,\n opts.pagesDir,\n opts.appDir,\n !!nextConfig.experimental.globalNotFound\n ))\n\n // If the route is actually an app page route, then we should have access\n // to the app route definition, and therefore, the appPaths from it.\n if (!appPaths && definition && isAppPageRouteDefinition(definition)) {\n appPaths = definition.appPaths\n }\n\n let page = routeDef.page\n if (appPaths) {\n const normalizedPage = normalizeAppPath(page)\n\n // filter out paths that are not exact matches (e.g. catchall)\n const matchingAppPaths = appPaths.filter(\n (path) => normalizeAppPath(path) === normalizedPage\n )\n\n // the last item in the array is the root page, if there are parallel routes\n page = matchingAppPaths[matchingAppPaths.length - 1]\n }\n\n const pathname = definition?.pathname ?? inputPage\n\n if (page === '/_error') {\n let finishBuilding = startBuilding(pathname, requestUrl, false)\n try {\n await handlePagesErrorRoute({\n currentEntryIssues,\n entrypoints: currentEntrypoints,\n manifestLoader,\n devRewrites: opts.fsChecker.rewrites,\n productionRewrites: undefined,\n logErrors: true,\n hooks: {\n subscribeToChanges,\n handleWrittenEndpoint: (id, result, forceDeleteCache) => {\n currentWrittenEntrypoints.set(id, result)\n assetMapper.setPathsForKey(id, result.clientPaths)\n return clearRequireCache(id, result, {\n force: forceDeleteCache,\n })\n },\n },\n })\n } finally {\n finishBuilding()\n }\n return\n }\n\n const isInsideAppDir = routeDef.bundlePath.startsWith('app/')\n const isEntryMetadataRouteFile = isMetadataRouteFile(\n routeDef.filename.replace(opts.appDir || '', ''),\n nextConfig.pageExtensions,\n true\n )\n const normalizedAppPage = isEntryMetadataRouteFile\n ? normalizedPageToTurbopackStructureRoute(\n page,\n extname(routeDef.filename)\n )\n : page\n\n const route = isInsideAppDir\n ? currentEntrypoints.app.get(normalizedAppPage)\n : currentEntrypoints.page.get(page)\n\n if (!route) {\n // TODO: why is this entry missing in turbopack?\n if (page === '/middleware') return\n if (page === '/src/middleware') return\n if (page === '/instrumentation') return\n if (page === '/src/instrumentation') return\n\n throw new PageNotFoundError(`route not found ${page}`)\n }\n\n // We don't throw on ensureOpts.isApp === true for page-api\n // since this can happen when app pages make\n // api requests to page API routes.\n if (isApp && route.type === 'page') {\n throw new Error(`mis-matched route type: isApp && page for ${page}`)\n }\n\n const finishBuilding = startBuilding(pathname, requestUrl, false)\n try {\n await handleRouteType({\n dev,\n page,\n pathname,\n route,\n currentEntryIssues,\n entrypoints: currentEntrypoints,\n manifestLoader,\n readyIds,\n devRewrites: opts.fsChecker.rewrites,\n productionRewrites: undefined,\n logErrors: true,\n\n hooks: {\n subscribeToChanges,\n handleWrittenEndpoint: (id, result, forceDeleteCache) => {\n currentWrittenEntrypoints.set(id, result)\n assetMapper.setPathsForKey(id, result.clientPaths)\n return clearRequireCache(id, result, {\n force: forceDeleteCache,\n })\n },\n },\n })\n } finally {\n finishBuilding()\n }\n })\n },\n close() {\n for (const wsClient of clients) {\n // it's okay to not cleanly close these websocket connections, this is dev\n wsClient.terminate()\n }\n clients.clear()\n clientsByRequestId.clear()\n },\n }\n\n handleEntrypointsSubscription().catch((err) => {\n console.error(err)\n process.exit(1)\n })\n\n // Write empty manifests\n await currentEntriesHandling\n await manifestLoader.writeManifests({\n devRewrites: opts.fsChecker.rewrites,\n productionRewrites: undefined,\n entrypoints: currentEntrypoints,\n })\n\n async function handleProjectUpdates() {\n for await (const updateMessage of project.updateInfoSubscribe(30)) {\n switch (updateMessage.updateType) {\n case 'start': {\n hotReloader.send({ type: HMR_MESSAGE_SENT_TO_BROWSER.BUILDING })\n break\n }\n case 'end': {\n sendEnqueuedMessages()\n\n function addErrors(\n errorsMap: Map<string, CompilationError>,\n issues: EntryIssuesMap\n ) {\n for (const issueMap of issues.values()) {\n for (const [key, issue] of issueMap) {\n if (issue.severity === 'warning') continue\n if (errorsMap.has(key)) continue\n\n const message = formatIssue(issue)\n\n errorsMap.set(key, {\n message,\n details: issue.detail\n ? renderStyledStringToErrorAnsi(issue.detail)\n : undefined,\n })\n }\n }\n }\n\n const errors = new Map<string, CompilationError>()\n addErrors(errors, currentEntryIssues)\n\n for (const client of clients) {\n const state = clientStates.get(client)\n if (!state) {\n continue\n }\n\n const clientErrors = new Map(errors)\n addErrors(clientErrors, state.clientIssues)\n\n sendToClient(client, {\n type: HMR_MESSAGE_SENT_TO_BROWSER.BUILT,\n hash: String(++hmrHash),\n errors: [...clientErrors.values()],\n warnings: [],\n })\n }\n\n if (hmrEventHappened) {\n const time = updateMessage.value.duration\n const timeMessage =\n time > 2000 ? `${Math.round(time / 100) / 10}s` : `${time}ms`\n Log.event(`Compiled in ${timeMessage}`)\n hmrEventHappened = false\n }\n break\n }\n default:\n }\n }\n }\n\n handleProjectUpdates().catch((err) => {\n console.error(err)\n process.exit(1)\n })\n\n return hotReloader\n}\n"],"names":["createHotReloaderTurbopack","wsServer","ws","Server","noServer","isTestMode","process","env","NEXT_TEST_MODE","__NEXT_TEST_MODE","DEBUG","sessionId","Math","floor","Number","MAX_SAFE_INTEGER","random","rewriteTurbopackSources","projectRoot","sourceMap","section","sections","map","i","sources","length","pathToFileURL","join","replace","toString","getSourceMapFromTurbopack","project","sourceURL","sourceMapJson","getSourceMapSync","err","undefined","payload","JSON","parse","opts","serverFields","distDir","resetFetch","nextConfig","dev","buildId","dir","projectPath","loadBindings","require","bindings","log","testMode","hasRewrites","fsChecker","rewrites","afterFiles","beforeFiles","fallback","hotReloaderSpan","trace","version","__NEXT_VERSION","stop","encryptionKey","generateEncryptionKeyBase64","isBuild","clientRouterFilters","experimental","clientRouterFilter","supportedBrowsers","getSupportedBrowsers","currentNodeJsVersion","versions","node","rootPath","turbopack","root","outputFileTracingRoot","turbo","createProject","normalizePath","relative","watch","enable","pollIntervalMs","watchOptions","defineEnv","createDefineEnv","isTurbopack","config","fetchCacheKeyPrefix","middlewareMatchers","previewProps","prerenderManifest","preview","browserslistQuery","noMangling","persistentCaching","isPersistentCachingEnabled","memoryLimit","turbopackMemoryLimit","isShortSession","backgroundLogCompilationEvents","eventTypes","setBundlerFindSourceMapImplementation","bind","onDevServerCleanup","onExit","entrypointsSubscription","entrypointsSubscribe","currentWrittenEntrypoints","Map","currentEntrypoints","global","app","document","error","middleware","instrumentation","page","currentTopLevelIssues","currentEntryIssues","manifestLoader","TurbopackManifestLoader","changeSubscriptions","serverPathState","readyIds","Set","currentEntriesHandlingResolve","currentEntriesHandling","Promise","resolve","assetMapper","AssetMapper","clearRequireCache","key","writtenEndpoint","force","path","contentHash","serverPaths","endsWith","localKey","set","hasChange","localHash","get","globalHash","__next__clear_chunk_cache__","p","file","clearModuleContext","deleteCache","buildingIds","startBuilding","id","requestUrl","forceRebuild","has","size","consoleStore","setState","loading","trigger","url","add","finishBuilding","delete","hmrEventHappened","hmrHash","clients","clientsByRequestId","clientStates","WeakMap","sendToClient","client","message","data","type","createBinaryHmrMessageData","stringify","send","sendEnqueuedMessages","issueMap","values","filter","severity","state","clientIssues","messages","clear","turbopackUpdates","HMR_MESSAGE_SENT_TO_BROWSER","TURBOPACK_MESSAGE","sendEnqueuedMessagesDebounce","debounce","sendHmr","sendTurbopackMessage","diagnostics","issues","push","subscribeToChanges","includeIssues","endpoint","createMessage","onError","side","splitEntryKey","changedPromise","changed","change","processIssues","String","e","unsubscribeFromChanges","subscription","return","subscribeToHmrEvents","getEntryKey","hasEntrypointForKey","subscriptions","hmrEvents","next","reloadMessage","RELOAD_PAGE","close","unsubscribeFromHmrEvents","handleEntrypointsSubscription","entrypoints","processTopLevelIssues","handleEntrypoints","devRewrites","productionRewrites","logErrors","hooks","handleWrittenEndpoint","result","forceDeleteCache","propagateServerField","mkdir","recursive","writeFile","middlewares","getOverlayMiddleware","isSrcDir","getSourceMapMiddleware","getNextErrorFeedbackMiddleware","telemetry","getDevOverlayFontMiddleware","getDisableDevIndicatorMiddleware","getRestartDevServerMiddleware","turbopackProject","devToolsConfigMiddleware","sendUpdateSignal","hotReloader","DEVTOOLS_CONFIG","versionInfoPromise","getVersionInfo","devtoolsFrontendUrl","nodeDebugType","getNodeDebugType","debugPort","debugInfo","debugInfoList","fetch","then","res","json","activeWebpackConfigs","serverStats","edgeServerStats","run","req","_parsedUrl","startsWith","params","matchNextPageBundleRequest","decodedPagePath","param","decodeURIComponent","denormalizedPagePath","denormalizePagePath","ensurePage","clientOnly","definition","catch","console","calledNext","finished","onHMR","socket","head","onUpgrade","handleUpgrade","requestId","URL","searchParams","on","deleteReactDebugChannel","addEventListener","parsedData","event","manualTraceChild","spanName","msToNs","startTime","endTime","attributes","updatedModules","isPageHidden","hadRuntimeError","dependencyChain","Log","warn","FAST_REFRESH_RUNTIME_RELOAD","Array","isArray","cleanedModulePath","browserDebugInfoInTerminal","receiveBrowserLogsTurbopack","entries","router","sourceType","Error","turbopackConnectedMessage","TURBOPACK_CONNECTED","errors","entryIssues","issue","formatIssue","printNonFatalIssue","devIndicatorServerState","disabledUntil","Date","now","versionInfo","devToolsConfig","getDevToolsConfig","syncMessage","SYNC","warnings","hash","debug","devIndicator","connectReactDebugChannel","action","setReactDebugChannel","debugChannel","htmlRequestId","setHmrServerError","_error","clearHmrServerError","start","getCompilationErrors","appEntryKey","pagesEntryKey","topLevelIssues","thisEntryIssues","formattedIssue","isWellKnownError","invalidate","reloadAfterInvalidation","entrypoint","clearAllModuleContexts","SERVER_COMPONENT_CHANGES","buildFallbackError","inputPage","appPaths","isApp","traceChild","traceAsyncFn","BLOCKED_PAGES","includes","routeDef","findPagePathData","pageExtensions","pagesDir","appDir","globalNotFound","isAppPageRouteDefinition","normalizedPage","normalizeAppPath","matchingAppPaths","pathname","handlePagesErrorRoute","setPathsForKey","clientPaths","isInsideAppDir","bundlePath","isEntryMetadataRouteFile","isMetadataRouteFile","filename","normalizedAppPage","normalizedPageToTurbopackStructureRoute","extname","route","PageNotFoundError","handleRouteType","wsClient","terminate","exit","writeManifests","handleProjectUpdates","updateMessage","updateInfoSubscribe","updateType","BUILDING","addErrors","errorsMap","details","detail","renderStyledStringToErrorAnsi","clientErrors","BUILT","time","value","duration","timeMessage","round"],"mappings":";;;;+BA0KsBA;;;eAAAA;;;0BAzKW;sBACO;qBACV;2DAEf;uBAGuB;kCASM;qBASZ;6DACX;oCAId;2BACuB;qCAIvB;uBAC2B;wBACT;8BACG;8BAIrB;qCAC6B;uBACd;gCAgBf;iCAKA;gCACiC;sCACP;0BAM1B;0BAIA;uCACqC;wCACH;0BACR;wBAEA;iCACG;mCACkB;gDACP;wBASxC;6CACqC;yCACJ;wCACS;4CACH;mCACC;wBACV;6BACO;+BACd;0CAIvB;8BAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEP,MAAMC,WAAW,IAAIC,WAAE,CAACC,MAAM,CAAC;IAAEC,UAAU;AAAK;AAChD,MAAMC,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B,CAAC6N,KAAK;gCACvCxE,MAAMjI,OAAO,EAAE3C;gCACf6J,QAAQ;uCAAIsF,aAAapO,MAAM;iCAAG;gCAClC4J,UAAU,EAAE;4BACd;wBACF;wBAEA,IAAI5K,kBAAkB;4BACpB,MAAMsP,OAAOX,cAAcY,KAAK,CAACC,QAAQ;4BACzC,MAAMC,cACJH,OAAO,OAAO,GAAGpZ,KAAKwZ,KAAK,CAACJ,OAAO,OAAO,GAAG,CAAC,CAAC,GAAG,GAAGA,KAAK,EAAE,CAAC;4BAC/DtG,KAAIX,KAAK,CAAC,CAAC,YAAY,EAAEoH,aAAa;4BACtCzP,mBAAmB;wBACrB;wBACA;oBACF;gBACA;YACF;QACF;IACF;IAEA0O,uBAAuBrH,KAAK,CAAC,CAAC5P;QAC5B6P,QAAQ1K,KAAK,CAACnF;QACd7B,QAAQ4Y,IAAI,CAAC;IACf;IAEA,OAAOlJ;AACT","ignoreList":[0]}
|
1
|
+
{"version":3,"sources":["../../../src/server/dev/hot-reloader-turbopack.ts"],"sourcesContent":["import type { Socket } from 'net'\nimport { mkdir, writeFile } from 'fs/promises'\nimport { join, extname, relative } from 'path'\nimport { pathToFileURL } from 'url'\n\nimport ws from 'next/dist/compiled/ws'\n\nimport type { OutputState } from '../../build/output/store'\nimport { store as consoleStore } from '../../build/output/store'\nimport type {\n CompilationError,\n HmrMessageSentToBrowser,\n NextJsHotReloaderInterface,\n ReloadPageMessage,\n SyncMessage,\n TurbopackConnectedMessage,\n} from './hot-reloader-types'\nimport { HMR_MESSAGE_SENT_TO_BROWSER } from './hot-reloader-types'\nimport type {\n Update as TurbopackUpdate,\n Endpoint,\n WrittenEndpoint,\n TurbopackResult,\n Project,\n Entrypoints,\n} from '../../build/swc/types'\nimport { createDefineEnv } from '../../build/swc'\nimport * as Log from '../../build/output/log'\nimport {\n getVersionInfo,\n matchNextPageBundleRequest,\n} from './hot-reloader-webpack'\nimport { BLOCKED_PAGES } from '../../shared/lib/constants'\nimport {\n getOverlayMiddleware,\n getSourceMapMiddleware,\n} from './middleware-turbopack'\nimport { PageNotFoundError } from '../../shared/lib/utils'\nimport { debounce } from '../utils'\nimport { deleteCache } from './require-cache'\nimport {\n clearAllModuleContexts,\n clearModuleContext,\n} from '../lib/render-server'\nimport { denormalizePagePath } from '../../shared/lib/page-path/denormalize-page-path'\nimport { trace } from '../../trace'\nimport {\n AssetMapper,\n type ChangeSubscriptions,\n type ClientState,\n handleEntrypoints,\n handlePagesErrorRoute,\n handleRouteType,\n hasEntrypointForKey,\n msToNs,\n type ReadyIds,\n type SendHmr,\n type StartBuilding,\n processTopLevelIssues,\n printNonFatalIssue,\n normalizedPageToTurbopackStructureRoute,\n} from './turbopack-utils'\nimport {\n propagateServerField,\n type ServerFields,\n type SetupOpts,\n} from '../lib/router-utils/setup-dev-bundler'\nimport { TurbopackManifestLoader } from '../../shared/lib/turbopack/manifest-loader'\nimport { findPagePathData } from './on-demand-entry-handler'\nimport type { RouteDefinition } from '../route-definitions/route-definition'\nimport {\n type EntryKey,\n getEntryKey,\n splitEntryKey,\n} from '../../shared/lib/turbopack/entry-key'\nimport {\n createBinaryHmrMessageData,\n FAST_REFRESH_RUNTIME_RELOAD,\n} from './messages'\nimport { generateEncryptionKeyBase64 } from '../app-render/encryption-utils-server'\nimport { isAppPageRouteDefinition } from '../route-definitions/app-page-route-definition'\nimport { normalizeAppPath } from '../../shared/lib/router/utils/app-paths'\nimport type { ModernSourceMapPayload } from '../lib/source-maps'\nimport { getNodeDebugType } from '../lib/utils'\nimport { isMetadataRouteFile } from '../../lib/metadata/is-metadata-route'\nimport { setBundlerFindSourceMapImplementation } from '../patch-error-inspect'\nimport { getNextErrorFeedbackMiddleware } from '../../next-devtools/server/get-next-error-feedback-middleware'\nimport {\n formatIssue,\n isPersistentCachingEnabled,\n isWellKnownError,\n processIssues,\n renderStyledStringToErrorAnsi,\n type EntryIssuesMap,\n type TopLevelIssuesMap,\n} from '../../shared/lib/turbopack/utils'\nimport { getDevOverlayFontMiddleware } from '../../next-devtools/server/font/get-dev-overlay-font-middleware'\nimport { devIndicatorServerState } from './dev-indicator-server-state'\nimport { getDisableDevIndicatorMiddleware } from '../../next-devtools/server/dev-indicator-middleware'\nimport { getRestartDevServerMiddleware } from '../../next-devtools/server/restart-dev-server-middleware'\nimport { backgroundLogCompilationEvents } from '../../shared/lib/turbopack/compilation-events'\nimport { getSupportedBrowsers } from '../../build/utils'\nimport { receiveBrowserLogsTurbopack } from './browser-logs/receive-logs'\nimport { normalizePath } from '../../lib/normalize-path'\nimport {\n devToolsConfigMiddleware,\n getDevToolsConfig,\n} from '../../next-devtools/server/devtools-config-middleware'\nimport {\n connectReactDebugChannel,\n deleteReactDebugChannel,\n setReactDebugChannel,\n} from './debug-channel'\n\nconst wsServer = new ws.Server({ noServer: true })\nconst isTestMode = !!(\n process.env.NEXT_TEST_MODE ||\n process.env.__NEXT_TEST_MODE ||\n process.env.DEBUG\n)\n\nconst sessionId = Math.floor(Number.MAX_SAFE_INTEGER * Math.random())\n\ndeclare const __next__clear_chunk_cache__: (() => void) | null | undefined\n\n/**\n * Replaces turbopack:///[project] with the specified project in the `source` field.\n */\nfunction rewriteTurbopackSources(\n projectRoot: string,\n sourceMap: ModernSourceMapPayload\n): void {\n if ('sections' in sourceMap) {\n for (const section of sourceMap.sections) {\n rewriteTurbopackSources(projectRoot, section.map)\n }\n } else {\n for (let i = 0; i < sourceMap.sources.length; i++) {\n sourceMap.sources[i] = pathToFileURL(\n join(\n projectRoot,\n sourceMap.sources[i].replace(/turbopack:\\/\\/\\/\\[project\\]/, '')\n )\n ).toString()\n }\n }\n}\n\nfunction getSourceMapFromTurbopack(\n project: Project,\n projectRoot: string,\n sourceURL: string\n): ModernSourceMapPayload | undefined {\n let sourceMapJson: string | null = null\n\n try {\n sourceMapJson = project.getSourceMapSync(sourceURL)\n } catch (err) {}\n\n if (sourceMapJson === null) {\n return undefined\n } else {\n const payload: ModernSourceMapPayload = JSON.parse(sourceMapJson)\n // The sourcemap from Turbopack is not yet written to disk so its `sources`\n // are not absolute paths yet. We need to rewrite them to be absolute paths.\n rewriteTurbopackSources(projectRoot, payload)\n return payload\n }\n}\n\nexport async function createHotReloaderTurbopack(\n opts: SetupOpts & { isSrcDir: boolean },\n serverFields: ServerFields,\n distDir: string,\n resetFetch: () => void\n): Promise<NextJsHotReloaderInterface> {\n const dev = true\n const buildId = 'development'\n const { nextConfig, dir: projectPath } = opts\n\n const { loadBindings } =\n require('../../build/swc') as typeof import('../../build/swc')\n\n let bindings = await loadBindings()\n\n // For the debugging purpose, check if createNext or equivalent next instance setup in test cases\n // works correctly. Normally `run-test` hides output so only will be visible when `--debug` flag is used.\n if (isTestMode) {\n ;(require('console') as typeof import('console')).log(\n 'Creating turbopack project',\n {\n dir: projectPath,\n testMode: isTestMode,\n }\n )\n }\n\n const hasRewrites =\n opts.fsChecker.rewrites.afterFiles.length > 0 ||\n opts.fsChecker.rewrites.beforeFiles.length > 0 ||\n opts.fsChecker.rewrites.fallback.length > 0\n\n const hotReloaderSpan = trace('hot-reloader', undefined, {\n version: process.env.__NEXT_VERSION as string,\n })\n // Ensure the hotReloaderSpan is flushed immediately as it's the parentSpan for all processing\n // of the current `next dev` invocation.\n hotReloaderSpan.stop()\n\n const encryptionKey = await generateEncryptionKeyBase64({\n isBuild: false,\n distDir,\n })\n\n // TODO: Implement\n let clientRouterFilters: any\n if (nextConfig.experimental.clientRouterFilter) {\n // TODO this need to be set correctly for persistent caching to work\n }\n\n const supportedBrowsers = getSupportedBrowsers(projectPath, dev)\n const currentNodeJsVersion = process.versions.node\n\n const rootPath =\n opts.nextConfig.turbopack?.root ||\n opts.nextConfig.outputFileTracingRoot ||\n projectPath\n const project = await bindings.turbo.createProject(\n {\n rootPath,\n projectPath: normalizePath(relative(rootPath, projectPath) || '.'),\n distDir,\n nextConfig: opts.nextConfig,\n watch: {\n enable: dev,\n pollIntervalMs: nextConfig.watchOptions?.pollIntervalMs,\n },\n dev,\n env: process.env as Record<string, string>,\n defineEnv: createDefineEnv({\n isTurbopack: true,\n clientRouterFilters,\n config: nextConfig,\n dev,\n distDir,\n projectPath,\n fetchCacheKeyPrefix: opts.nextConfig.experimental.fetchCacheKeyPrefix,\n hasRewrites,\n // TODO: Implement\n middlewareMatchers: undefined,\n rewrites: opts.fsChecker.rewrites,\n }),\n buildId,\n encryptionKey,\n previewProps: opts.fsChecker.prerenderManifest.preview,\n browserslistQuery: supportedBrowsers.join(', '),\n noMangling: false,\n currentNodeJsVersion,\n },\n {\n persistentCaching: isPersistentCachingEnabled(opts.nextConfig),\n memoryLimit: opts.nextConfig.experimental?.turbopackMemoryLimit,\n isShortSession: false,\n }\n )\n backgroundLogCompilationEvents(project, {\n eventTypes: ['StartupCacheInvalidationEvent', 'TimingEvent'],\n })\n setBundlerFindSourceMapImplementation(\n getSourceMapFromTurbopack.bind(null, project, projectPath)\n )\n opts.onDevServerCleanup?.(async () => {\n setBundlerFindSourceMapImplementation(() => undefined)\n await project.onExit()\n })\n const entrypointsSubscription = project.entrypointsSubscribe()\n\n const currentWrittenEntrypoints: Map<EntryKey, WrittenEndpoint> = new Map()\n const currentEntrypoints: Entrypoints = {\n global: {\n app: undefined,\n document: undefined,\n error: undefined,\n\n middleware: undefined,\n instrumentation: undefined,\n },\n\n page: new Map(),\n app: new Map(),\n }\n\n const currentTopLevelIssues: TopLevelIssuesMap = new Map()\n const currentEntryIssues: EntryIssuesMap = new Map()\n\n const manifestLoader = new TurbopackManifestLoader({\n buildId,\n distDir,\n encryptionKey,\n })\n\n // Dev specific\n const changeSubscriptions: ChangeSubscriptions = new Map()\n const serverPathState = new Map<string, string>()\n const readyIds: ReadyIds = new Set()\n let currentEntriesHandlingResolve: ((value?: unknown) => void) | undefined\n let currentEntriesHandling = new Promise(\n (resolve) => (currentEntriesHandlingResolve = resolve)\n )\n\n const assetMapper = new AssetMapper()\n\n function clearRequireCache(\n key: EntryKey,\n writtenEndpoint: WrittenEndpoint,\n {\n force,\n }: {\n // Always clear the cache, don't check if files have changed\n force?: boolean\n } = {}\n ): boolean {\n if (force) {\n for (const { path, contentHash } of writtenEndpoint.serverPaths) {\n // We ignore source maps\n if (path.endsWith('.map')) continue\n const localKey = `${key}:${path}`\n serverPathState.set(localKey, contentHash)\n serverPathState.set(path, contentHash)\n }\n } else {\n // Figure out if the server files have changed\n let hasChange = false\n for (const { path, contentHash } of writtenEndpoint.serverPaths) {\n // We ignore source maps\n if (path.endsWith('.map')) continue\n const localKey = `${key}:${path}`\n const localHash = serverPathState.get(localKey)\n const globalHash = serverPathState.get(path)\n if (\n (localHash && localHash !== contentHash) ||\n (globalHash && globalHash !== contentHash)\n ) {\n hasChange = true\n serverPathState.set(localKey, contentHash)\n serverPathState.set(path, contentHash)\n } else {\n if (!localHash) {\n serverPathState.set(localKey, contentHash)\n }\n if (!globalHash) {\n serverPathState.set(path, contentHash)\n }\n }\n }\n\n if (!hasChange) {\n return false\n }\n }\n\n resetFetch()\n\n // Not available in:\n // - Pages Router (no server-side HMR)\n // - Edge Runtime (uses browser runtime which already disposes chunks individually)\n if (typeof __next__clear_chunk_cache__ === 'function') {\n __next__clear_chunk_cache__()\n }\n\n const serverPaths = writtenEndpoint.serverPaths.map(({ path: p }) =>\n join(distDir, p)\n )\n\n for (const file of serverPaths) {\n clearModuleContext(file)\n deleteCache(file)\n }\n\n return true\n }\n\n const buildingIds = new Set()\n\n const startBuilding: StartBuilding = (id, requestUrl, forceRebuild) => {\n if (!forceRebuild && readyIds.has(id)) {\n return () => {}\n }\n if (buildingIds.size === 0) {\n consoleStore.setState(\n {\n loading: true,\n trigger: id,\n url: requestUrl,\n } as OutputState,\n true\n )\n }\n buildingIds.add(id)\n return function finishBuilding() {\n if (buildingIds.size === 0) {\n return\n }\n readyIds.add(id)\n buildingIds.delete(id)\n if (buildingIds.size === 0) {\n hmrEventHappened = false\n consoleStore.setState(\n {\n loading: false,\n } as OutputState,\n true\n )\n }\n }\n }\n\n let hmrEventHappened = false\n let hmrHash = 0\n\n const clients = new Set<ws>()\n const clientsByRequestId = new Map<string, ws>()\n const clientStates = new WeakMap<ws, ClientState>()\n\n function sendToClient(client: ws, message: HmrMessageSentToBrowser) {\n const data =\n typeof message.type === 'number'\n ? createBinaryHmrMessageData(message)\n : JSON.stringify(message)\n\n client.send(data)\n }\n\n function sendEnqueuedMessages() {\n for (const [, issueMap] of currentEntryIssues) {\n if (\n [...issueMap.values()].filter((i) => i.severity !== 'warning').length >\n 0\n ) {\n // During compilation errors we want to delay the HMR events until errors are fixed\n return\n }\n }\n\n for (const client of clients) {\n const state = clientStates.get(client)\n if (!state) {\n continue\n }\n\n for (const [, issueMap] of state.clientIssues) {\n if (\n [...issueMap.values()].filter((i) => i.severity !== 'warning')\n .length > 0\n ) {\n // During compilation errors we want to delay the HMR events until errors are fixed\n return\n }\n }\n\n for (const message of state.messages.values()) {\n sendToClient(client, message)\n }\n state.messages.clear()\n\n if (state.turbopackUpdates.length > 0) {\n sendToClient(client, {\n type: HMR_MESSAGE_SENT_TO_BROWSER.TURBOPACK_MESSAGE,\n data: state.turbopackUpdates,\n })\n state.turbopackUpdates.length = 0\n }\n }\n }\n const sendEnqueuedMessagesDebounce = debounce(sendEnqueuedMessages, 2)\n\n const sendHmr: SendHmr = (id: string, message: HmrMessageSentToBrowser) => {\n for (const client of clients) {\n clientStates.get(client)?.messages.set(id, message)\n }\n\n hmrEventHappened = true\n sendEnqueuedMessagesDebounce()\n }\n\n function sendTurbopackMessage(payload: TurbopackUpdate) {\n // TODO(PACK-2049): For some reason we end up emitting hundreds of issues messages on bigger apps,\n // a lot of which are duplicates.\n // They are currently not handled on the client at all, so might as well not send them for now.\n payload.diagnostics = []\n payload.issues = []\n\n for (const client of clients) {\n clientStates.get(client)?.turbopackUpdates.push(payload)\n }\n\n hmrEventHappened = true\n sendEnqueuedMessagesDebounce()\n }\n\n async function subscribeToChanges(\n key: EntryKey,\n includeIssues: boolean,\n endpoint: Endpoint,\n createMessage: (\n change: TurbopackResult,\n hash: string\n ) => Promise<HmrMessageSentToBrowser> | HmrMessageSentToBrowser | void,\n onError?: (\n error: Error\n ) => Promise<HmrMessageSentToBrowser> | HmrMessageSentToBrowser | void\n ) {\n if (changeSubscriptions.has(key)) {\n return\n }\n\n const { side } = splitEntryKey(key)\n\n const changedPromise = endpoint[`${side}Changed`](includeIssues)\n changeSubscriptions.set(key, changedPromise)\n try {\n const changed = await changedPromise\n\n for await (const change of changed) {\n processIssues(currentEntryIssues, key, change, false, true)\n // TODO: Get an actual content hash from Turbopack.\n const message = await createMessage(change, String(++hmrHash))\n if (message) {\n sendHmr(key, message)\n }\n }\n } catch (e) {\n changeSubscriptions.delete(key)\n const payload = await onError?.(e as Error)\n if (payload) {\n sendHmr(key, payload)\n }\n return\n }\n changeSubscriptions.delete(key)\n }\n\n async function unsubscribeFromChanges(key: EntryKey) {\n const subscription = await changeSubscriptions.get(key)\n if (subscription) {\n await subscription.return?.()\n changeSubscriptions.delete(key)\n }\n currentEntryIssues.delete(key)\n }\n\n async function subscribeToHmrEvents(client: ws, id: string) {\n const key = getEntryKey('assets', 'client', id)\n if (!hasEntrypointForKey(currentEntrypoints, key, assetMapper)) {\n // maybe throw an error / force the client to reload?\n return\n }\n\n const state = clientStates.get(client)\n if (!state || state.subscriptions.has(id)) {\n return\n }\n\n const subscription = project!.hmrEvents(id)\n state.subscriptions.set(id, subscription)\n\n // The subscription will always emit once, which is the initial\n // computation. This is not a change, so swallow it.\n try {\n await subscription.next()\n\n for await (const data of subscription) {\n processIssues(state.clientIssues, key, data, false, true)\n if (data.type !== 'issues') {\n sendTurbopackMessage(data)\n }\n }\n } catch (e) {\n // The client might be using an HMR session from a previous server, tell them\n // to fully reload the page to resolve the issue. We can't use\n // `hotReloader.send` since that would force every connected client to\n // reload, only this client is out of date.\n const reloadMessage: ReloadPageMessage = {\n type: HMR_MESSAGE_SENT_TO_BROWSER.RELOAD_PAGE,\n data: `error in HMR event subscription for ${id}: ${e}`,\n }\n sendToClient(client, reloadMessage)\n client.close()\n return\n }\n }\n\n function unsubscribeFromHmrEvents(client: ws, id: string) {\n const state = clientStates.get(client)\n if (!state) {\n return\n }\n\n const subscription = state.subscriptions.get(id)\n subscription?.return!()\n\n const key = getEntryKey('assets', 'client', id)\n state.clientIssues.delete(key)\n }\n\n async function handleEntrypointsSubscription() {\n for await (const entrypoints of entrypointsSubscription) {\n if (!currentEntriesHandlingResolve) {\n currentEntriesHandling = new Promise(\n // eslint-disable-next-line no-loop-func\n (resolve) => (currentEntriesHandlingResolve = resolve)\n )\n }\n\n processTopLevelIssues(currentTopLevelIssues, entrypoints)\n\n await handleEntrypoints({\n entrypoints,\n\n currentEntrypoints,\n\n currentEntryIssues,\n manifestLoader,\n devRewrites: opts.fsChecker.rewrites,\n productionRewrites: undefined,\n logErrors: true,\n\n dev: {\n assetMapper,\n changeSubscriptions,\n clients,\n clientStates,\n serverFields,\n\n hooks: {\n handleWrittenEndpoint: (id, result, forceDeleteCache) => {\n currentWrittenEntrypoints.set(id, result)\n return clearRequireCache(id, result, { force: forceDeleteCache })\n },\n propagateServerField: propagateServerField.bind(null, opts),\n sendHmr,\n startBuilding,\n subscribeToChanges,\n unsubscribeFromChanges,\n unsubscribeFromHmrEvents,\n },\n },\n })\n\n currentEntriesHandlingResolve!()\n currentEntriesHandlingResolve = undefined\n }\n }\n\n await mkdir(join(distDir, 'server'), { recursive: true })\n await mkdir(join(distDir, 'static', buildId), { recursive: true })\n await writeFile(\n join(distDir, 'package.json'),\n JSON.stringify(\n {\n type: 'commonjs',\n },\n null,\n 2\n )\n )\n\n const middlewares = [\n getOverlayMiddleware({\n project,\n projectPath,\n isSrcDir: opts.isSrcDir,\n }),\n getSourceMapMiddleware(project),\n getNextErrorFeedbackMiddleware(opts.telemetry),\n getDevOverlayFontMiddleware(),\n getDisableDevIndicatorMiddleware(),\n getRestartDevServerMiddleware({\n telemetry: opts.telemetry,\n turbopackProject: project,\n }),\n devToolsConfigMiddleware({\n distDir,\n sendUpdateSignal: (data) => {\n hotReloader.send({\n type: HMR_MESSAGE_SENT_TO_BROWSER.DEVTOOLS_CONFIG,\n data,\n })\n },\n }),\n ]\n\n let versionInfoCached: ReturnType<typeof getVersionInfo> | undefined\n // This fetch, even though not awaited, is not kicked off eagerly because the first `fetch()` in\n // Node.js adds roughly 20ms main-thread blocking to load the SSL certificate cache\n // We don't want that blocking time to be in the hot path for the `ready in` logging.\n // Instead, the fetch is kicked off lazily when the first `getVersionInfoCached()` is called.\n const getVersionInfoCached = (): ReturnType<typeof getVersionInfo> => {\n if (!versionInfoCached) {\n versionInfoCached = getVersionInfo()\n }\n return versionInfoCached\n }\n\n let devtoolsFrontendUrl: string | undefined\n const nodeDebugType = getNodeDebugType()\n if (nodeDebugType) {\n const debugPort = process.debugPort\n let debugInfo\n try {\n // It requires to use 127.0.0.1 instead of localhost for server-side fetching.\n const debugInfoList = await fetch(\n `http://127.0.0.1:${debugPort}/json/list`\n ).then((res) => res.json())\n debugInfo = debugInfoList[0]\n } catch {}\n if (debugInfo) {\n devtoolsFrontendUrl = debugInfo.devtoolsFrontendUrl\n }\n }\n\n const hotReloader: NextJsHotReloaderInterface = {\n turbopackProject: project,\n activeWebpackConfigs: undefined,\n serverStats: null,\n edgeServerStats: null,\n async run(req, res, _parsedUrl) {\n // intercept page chunks request and ensure them with turbopack\n if (req.url?.startsWith('/_next/static/chunks/pages/')) {\n const params = matchNextPageBundleRequest(req.url)\n\n if (params) {\n const decodedPagePath = `/${params.path\n .map((param: string) => decodeURIComponent(param))\n .join('/')}`\n\n const denormalizedPagePath = denormalizePagePath(decodedPagePath)\n\n await hotReloader\n .ensurePage({\n page: denormalizedPagePath,\n clientOnly: false,\n definition: undefined,\n url: req.url,\n })\n .catch(console.error)\n }\n }\n\n for (const middleware of middlewares) {\n let calledNext = false\n\n await middleware(req, res, () => {\n calledNext = true\n })\n\n if (!calledNext) {\n return { finished: true }\n }\n }\n\n // Request was not finished.\n return { finished: undefined }\n },\n\n // TODO: Figure out if socket type can match the NextJsHotReloaderInterface\n onHMR(req, socket: Socket, head, onUpgrade) {\n wsServer.handleUpgrade(req, socket, head, (client) => {\n onUpgrade(client)\n const clientIssues: EntryIssuesMap = new Map()\n const subscriptions: Map<string, AsyncIterator<any>> = new Map()\n\n clients.add(client)\n\n const requestId = req.url\n ? new URL(req.url, 'http://n').searchParams.get('id')\n : null\n\n if (requestId) {\n clientsByRequestId.set(requestId, client)\n }\n\n clientStates.set(client, {\n clientIssues,\n messages: new Map(),\n turbopackUpdates: [],\n subscriptions,\n })\n\n client.on('close', () => {\n // Remove active subscriptions\n for (const subscription of subscriptions.values()) {\n subscription.return?.()\n }\n clientStates.delete(client)\n clients.delete(client)\n\n if (requestId) {\n clientsByRequestId.delete(requestId)\n deleteReactDebugChannel(requestId)\n }\n })\n\n client.addEventListener('message', async ({ data }) => {\n const parsedData = JSON.parse(\n typeof data !== 'string' ? data.toString() : data\n )\n\n // Next.js messages\n switch (parsedData.event) {\n case 'span-end': {\n hotReloaderSpan.manualTraceChild(\n parsedData.spanName,\n msToNs(parsedData.startTime),\n msToNs(parsedData.endTime),\n parsedData.attributes\n )\n break\n }\n case 'client-hmr-latency': // { id, startTime, endTime, page, updatedModules, isPageHidden }\n hotReloaderSpan.manualTraceChild(\n parsedData.event,\n msToNs(parsedData.startTime),\n msToNs(parsedData.endTime),\n {\n updatedModules: parsedData.updatedModules,\n page: parsedData.page,\n isPageHidden: parsedData.isPageHidden,\n }\n )\n break\n\n case 'client-error': // { errorCount, clientId }\n case 'client-warning': // { warningCount, clientId }\n case 'client-success': // { clientId }\n case 'server-component-reload-page': // { clientId }\n case 'client-reload-page': // { clientId }\n case 'client-removed-page': // { page }\n case 'client-full-reload': // { stackTrace, hadRuntimeError }\n const { hadRuntimeError, dependencyChain } = parsedData\n if (hadRuntimeError) {\n Log.warn(FAST_REFRESH_RUNTIME_RELOAD)\n }\n if (\n Array.isArray(dependencyChain) &&\n typeof dependencyChain[0] === 'string'\n ) {\n const cleanedModulePath = dependencyChain[0]\n .replace(/^\\[project\\]/, '.')\n .replace(/ \\[.*\\] \\(.*\\)$/, '')\n Log.warn(\n `Fast Refresh had to perform a full reload when ${cleanedModulePath} changed. Read more: https://nextjs.org/docs/messages/fast-refresh-reload`\n )\n }\n break\n case 'client-added-page':\n // TODO\n break\n case 'browser-logs': {\n if (nextConfig.experimental.browserDebugInfoInTerminal) {\n await receiveBrowserLogsTurbopack({\n entries: parsedData.entries,\n router: parsedData.router,\n sourceType: parsedData.sourceType,\n project,\n projectPath,\n distDir,\n config: nextConfig.experimental.browserDebugInfoInTerminal,\n })\n }\n break\n }\n\n default:\n // Might be a Turbopack message...\n if (!parsedData.type) {\n throw new Error(`unrecognized HMR message \"${data}\"`)\n }\n }\n\n // Turbopack messages\n switch (parsedData.type) {\n case 'turbopack-subscribe':\n subscribeToHmrEvents(client, parsedData.path)\n break\n\n case 'turbopack-unsubscribe':\n unsubscribeFromHmrEvents(client, parsedData.path)\n break\n\n default:\n if (!parsedData.event) {\n throw new Error(`unrecognized Turbopack HMR message \"${data}\"`)\n }\n }\n })\n\n const turbopackConnectedMessage: TurbopackConnectedMessage = {\n type: HMR_MESSAGE_SENT_TO_BROWSER.TURBOPACK_CONNECTED,\n data: { sessionId },\n }\n sendToClient(client, turbopackConnectedMessage)\n\n const errors: CompilationError[] = []\n\n for (const entryIssues of currentEntryIssues.values()) {\n for (const issue of entryIssues.values()) {\n if (issue.severity !== 'warning') {\n errors.push({\n message: formatIssue(issue),\n })\n } else {\n printNonFatalIssue(issue)\n }\n }\n }\n\n if (devIndicatorServerState.disabledUntil < Date.now()) {\n devIndicatorServerState.disabledUntil = 0\n }\n\n ;(async function () {\n const versionInfo = await getVersionInfoCached()\n const devToolsConfig = await getDevToolsConfig(distDir)\n\n const syncMessage: SyncMessage = {\n type: HMR_MESSAGE_SENT_TO_BROWSER.SYNC,\n errors,\n warnings: [],\n hash: '',\n versionInfo,\n debug: {\n devtoolsFrontendUrl,\n },\n devIndicator: devIndicatorServerState,\n devToolsConfig,\n }\n\n sendToClient(client, syncMessage)\n\n if (requestId) {\n connectReactDebugChannel(requestId, sendToClient.bind(null, client))\n }\n })()\n })\n },\n\n send(action) {\n const payload = JSON.stringify(action)\n\n for (const client of clients) {\n client.send(payload)\n }\n },\n\n setReactDebugChannel(debugChannel, htmlRequestId, requestId) {\n // Store the debug channel, regardless of whether the client is connected.\n setReactDebugChannel(requestId, debugChannel)\n\n // If the client is connected, we can connect the debug channel\n // immediately. Otherwise, we'll do that when the client connects.\n const client = clientsByRequestId.get(htmlRequestId)\n\n if (client) {\n connectReactDebugChannel(requestId, sendToClient.bind(null, client))\n }\n },\n\n setHmrServerError(_error) {\n // Not implemented yet.\n },\n clearHmrServerError() {\n // Not implemented yet.\n },\n async start() {},\n async getCompilationErrors(page) {\n const appEntryKey = getEntryKey('app', 'server', page)\n const pagesEntryKey = getEntryKey('pages', 'server', page)\n\n const topLevelIssues = currentTopLevelIssues.values()\n\n const thisEntryIssues =\n currentEntryIssues.get(appEntryKey) ??\n currentEntryIssues.get(pagesEntryKey)\n\n if (thisEntryIssues !== undefined && thisEntryIssues.size > 0) {\n // If there is an error related to the requesting page we display it instead of the first error\n return [...topLevelIssues, ...thisEntryIssues.values()]\n .map((issue) => {\n const formattedIssue = formatIssue(issue)\n if (issue.severity === 'warning') {\n printNonFatalIssue(issue)\n return null\n } else if (isWellKnownError(issue)) {\n Log.error(formattedIssue)\n }\n\n return new Error(formattedIssue)\n })\n .filter((error) => error !== null)\n }\n\n // Otherwise, return all errors across pages\n const errors = []\n for (const issue of topLevelIssues) {\n if (issue.severity !== 'warning') {\n errors.push(new Error(formatIssue(issue)))\n }\n }\n for (const entryIssues of currentEntryIssues.values()) {\n for (const issue of entryIssues.values()) {\n if (issue.severity !== 'warning') {\n const message = formatIssue(issue)\n errors.push(new Error(message))\n } else {\n printNonFatalIssue(issue)\n }\n }\n }\n return errors\n },\n async invalidate({\n // .env files or tsconfig/jsconfig change\n reloadAfterInvalidation,\n }) {\n if (reloadAfterInvalidation) {\n for (const [key, entrypoint] of currentWrittenEntrypoints) {\n clearRequireCache(key, entrypoint, { force: true })\n }\n\n await clearAllModuleContexts()\n this.send({\n type: HMR_MESSAGE_SENT_TO_BROWSER.SERVER_COMPONENT_CHANGES,\n hash: String(++hmrHash),\n })\n }\n },\n async buildFallbackError() {\n // Not implemented yet.\n },\n async ensurePage({\n page: inputPage,\n // Unused parameters\n // clientOnly,\n appPaths,\n definition,\n isApp,\n url: requestUrl,\n }) {\n // When there is no route definition this is an internal file not a route the user added.\n // Middleware and instrumentation are handled in turbpack-utils.ts handleEntrypoints instead.\n if (!definition) {\n if (inputPage === '/middleware') return\n if (inputPage === '/src/middleware') return\n if (inputPage === '/instrumentation') return\n if (inputPage === '/src/instrumentation') return\n }\n\n return hotReloaderSpan\n .traceChild('ensure-page', {\n inputPage,\n })\n .traceAsyncFn(async () => {\n if (BLOCKED_PAGES.includes(inputPage) && inputPage !== '/_error') {\n return\n }\n\n await currentEntriesHandling\n\n // TODO We shouldn't look into the filesystem again. This should use the information from entrypoints\n let routeDef: Pick<\n RouteDefinition,\n 'filename' | 'bundlePath' | 'page'\n > =\n definition ??\n (await findPagePathData(\n projectPath,\n inputPage,\n nextConfig.pageExtensions,\n opts.pagesDir,\n opts.appDir,\n !!nextConfig.experimental.globalNotFound\n ))\n\n // If the route is actually an app page route, then we should have access\n // to the app route definition, and therefore, the appPaths from it.\n if (!appPaths && definition && isAppPageRouteDefinition(definition)) {\n appPaths = definition.appPaths\n }\n\n let page = routeDef.page\n if (appPaths) {\n const normalizedPage = normalizeAppPath(page)\n\n // filter out paths that are not exact matches (e.g. catchall)\n const matchingAppPaths = appPaths.filter(\n (path) => normalizeAppPath(path) === normalizedPage\n )\n\n // the last item in the array is the root page, if there are parallel routes\n page = matchingAppPaths[matchingAppPaths.length - 1]\n }\n\n const pathname = definition?.pathname ?? inputPage\n\n if (page === '/_error') {\n let finishBuilding = startBuilding(pathname, requestUrl, false)\n try {\n await handlePagesErrorRoute({\n currentEntryIssues,\n entrypoints: currentEntrypoints,\n manifestLoader,\n devRewrites: opts.fsChecker.rewrites,\n productionRewrites: undefined,\n logErrors: true,\n hooks: {\n subscribeToChanges,\n handleWrittenEndpoint: (id, result, forceDeleteCache) => {\n currentWrittenEntrypoints.set(id, result)\n assetMapper.setPathsForKey(id, result.clientPaths)\n return clearRequireCache(id, result, {\n force: forceDeleteCache,\n })\n },\n },\n })\n } finally {\n finishBuilding()\n }\n return\n }\n\n const isInsideAppDir = routeDef.bundlePath.startsWith('app/')\n const isEntryMetadataRouteFile = isMetadataRouteFile(\n routeDef.filename.replace(opts.appDir || '', ''),\n nextConfig.pageExtensions,\n true\n )\n const normalizedAppPage = isEntryMetadataRouteFile\n ? normalizedPageToTurbopackStructureRoute(\n page,\n extname(routeDef.filename)\n )\n : page\n\n const route = isInsideAppDir\n ? currentEntrypoints.app.get(normalizedAppPage)\n : currentEntrypoints.page.get(page)\n\n if (!route) {\n // TODO: why is this entry missing in turbopack?\n if (page === '/middleware') return\n if (page === '/src/middleware') return\n if (page === '/instrumentation') return\n if (page === '/src/instrumentation') return\n\n throw new PageNotFoundError(`route not found ${page}`)\n }\n\n // We don't throw on ensureOpts.isApp === true for page-api\n // since this can happen when app pages make\n // api requests to page API routes.\n if (isApp && route.type === 'page') {\n throw new Error(`mis-matched route type: isApp && page for ${page}`)\n }\n\n const finishBuilding = startBuilding(pathname, requestUrl, false)\n try {\n await handleRouteType({\n dev,\n page,\n pathname,\n route,\n currentEntryIssues,\n entrypoints: currentEntrypoints,\n manifestLoader,\n readyIds,\n devRewrites: opts.fsChecker.rewrites,\n productionRewrites: undefined,\n logErrors: true,\n\n hooks: {\n subscribeToChanges,\n handleWrittenEndpoint: (id, result, forceDeleteCache) => {\n currentWrittenEntrypoints.set(id, result)\n assetMapper.setPathsForKey(id, result.clientPaths)\n return clearRequireCache(id, result, {\n force: forceDeleteCache,\n })\n },\n },\n })\n } finally {\n finishBuilding()\n }\n })\n },\n close() {\n for (const wsClient of clients) {\n // it's okay to not cleanly close these websocket connections, this is dev\n wsClient.terminate()\n }\n clients.clear()\n clientsByRequestId.clear()\n },\n }\n\n handleEntrypointsSubscription().catch((err) => {\n console.error(err)\n process.exit(1)\n })\n\n // Write empty manifests\n await currentEntriesHandling\n await manifestLoader.writeManifests({\n devRewrites: opts.fsChecker.rewrites,\n productionRewrites: undefined,\n entrypoints: currentEntrypoints,\n })\n\n async function handleProjectUpdates() {\n for await (const updateMessage of project.updateInfoSubscribe(30)) {\n switch (updateMessage.updateType) {\n case 'start': {\n hotReloader.send({ type: HMR_MESSAGE_SENT_TO_BROWSER.BUILDING })\n break\n }\n case 'end': {\n sendEnqueuedMessages()\n\n function addErrors(\n errorsMap: Map<string, CompilationError>,\n issues: EntryIssuesMap\n ) {\n for (const issueMap of issues.values()) {\n for (const [key, issue] of issueMap) {\n if (issue.severity === 'warning') continue\n if (errorsMap.has(key)) continue\n\n const message = formatIssue(issue)\n\n errorsMap.set(key, {\n message,\n details: issue.detail\n ? renderStyledStringToErrorAnsi(issue.detail)\n : undefined,\n })\n }\n }\n }\n\n const errors = new Map<string, CompilationError>()\n addErrors(errors, currentEntryIssues)\n\n for (const client of clients) {\n const state = clientStates.get(client)\n if (!state) {\n continue\n }\n\n const clientErrors = new Map(errors)\n addErrors(clientErrors, state.clientIssues)\n\n sendToClient(client, {\n type: HMR_MESSAGE_SENT_TO_BROWSER.BUILT,\n hash: String(++hmrHash),\n errors: [...clientErrors.values()],\n warnings: [],\n })\n }\n\n if (hmrEventHappened) {\n const time = updateMessage.value.duration\n const timeMessage =\n time > 2000 ? `${Math.round(time / 100) / 10}s` : `${time}ms`\n Log.event(`Compiled in ${timeMessage}`)\n hmrEventHappened = false\n }\n break\n }\n default:\n }\n }\n }\n\n handleProjectUpdates().catch((err) => {\n console.error(err)\n process.exit(1)\n })\n\n return hotReloader\n}\n"],"names":["createHotReloaderTurbopack","wsServer","ws","Server","noServer","isTestMode","process","env","NEXT_TEST_MODE","__NEXT_TEST_MODE","DEBUG","sessionId","Math","floor","Number","MAX_SAFE_INTEGER","random","rewriteTurbopackSources","projectRoot","sourceMap","section","sections","map","i","sources","length","pathToFileURL","join","replace","toString","getSourceMapFromTurbopack","project","sourceURL","sourceMapJson","getSourceMapSync","err","undefined","payload","JSON","parse","opts","serverFields","distDir","resetFetch","nextConfig","dev","buildId","dir","projectPath","loadBindings","require","bindings","log","testMode","hasRewrites","fsChecker","rewrites","afterFiles","beforeFiles","fallback","hotReloaderSpan","trace","version","__NEXT_VERSION","stop","encryptionKey","generateEncryptionKeyBase64","isBuild","clientRouterFilters","experimental","clientRouterFilter","supportedBrowsers","getSupportedBrowsers","currentNodeJsVersion","versions","node","rootPath","turbopack","root","outputFileTracingRoot","turbo","createProject","normalizePath","relative","watch","enable","pollIntervalMs","watchOptions","defineEnv","createDefineEnv","isTurbopack","config","fetchCacheKeyPrefix","middlewareMatchers","previewProps","prerenderManifest","preview","browserslistQuery","noMangling","persistentCaching","isPersistentCachingEnabled","memoryLimit","turbopackMemoryLimit","isShortSession","backgroundLogCompilationEvents","eventTypes","setBundlerFindSourceMapImplementation","bind","onDevServerCleanup","onExit","entrypointsSubscription","entrypointsSubscribe","currentWrittenEntrypoints","Map","currentEntrypoints","global","app","document","error","middleware","instrumentation","page","currentTopLevelIssues","currentEntryIssues","manifestLoader","TurbopackManifestLoader","changeSubscriptions","serverPathState","readyIds","Set","currentEntriesHandlingResolve","currentEntriesHandling","Promise","resolve","assetMapper","AssetMapper","clearRequireCache","key","writtenEndpoint","force","path","contentHash","serverPaths","endsWith","localKey","set","hasChange","localHash","get","globalHash","__next__clear_chunk_cache__","p","file","clearModuleContext","deleteCache","buildingIds","startBuilding","id","requestUrl","forceRebuild","has","size","consoleStore","setState","loading","trigger","url","add","finishBuilding","delete","hmrEventHappened","hmrHash","clients","clientsByRequestId","clientStates","WeakMap","sendToClient","client","message","data","type","createBinaryHmrMessageData","stringify","send","sendEnqueuedMessages","issueMap","values","filter","severity","state","clientIssues","messages","clear","turbopackUpdates","HMR_MESSAGE_SENT_TO_BROWSER","TURBOPACK_MESSAGE","sendEnqueuedMessagesDebounce","debounce","sendHmr","sendTurbopackMessage","diagnostics","issues","push","subscribeToChanges","includeIssues","endpoint","createMessage","onError","side","splitEntryKey","changedPromise","changed","change","processIssues","String","e","unsubscribeFromChanges","subscription","return","subscribeToHmrEvents","getEntryKey","hasEntrypointForKey","subscriptions","hmrEvents","next","reloadMessage","RELOAD_PAGE","close","unsubscribeFromHmrEvents","handleEntrypointsSubscription","entrypoints","processTopLevelIssues","handleEntrypoints","devRewrites","productionRewrites","logErrors","hooks","handleWrittenEndpoint","result","forceDeleteCache","propagateServerField","mkdir","recursive","writeFile","middlewares","getOverlayMiddleware","isSrcDir","getSourceMapMiddleware","getNextErrorFeedbackMiddleware","telemetry","getDevOverlayFontMiddleware","getDisableDevIndicatorMiddleware","getRestartDevServerMiddleware","turbopackProject","devToolsConfigMiddleware","sendUpdateSignal","hotReloader","DEVTOOLS_CONFIG","versionInfoCached","getVersionInfoCached","getVersionInfo","devtoolsFrontendUrl","nodeDebugType","getNodeDebugType","debugPort","debugInfo","debugInfoList","fetch","then","res","json","activeWebpackConfigs","serverStats","edgeServerStats","run","req","_parsedUrl","startsWith","params","matchNextPageBundleRequest","decodedPagePath","param","decodeURIComponent","denormalizedPagePath","denormalizePagePath","ensurePage","clientOnly","definition","catch","console","calledNext","finished","onHMR","socket","head","onUpgrade","handleUpgrade","requestId","URL","searchParams","on","deleteReactDebugChannel","addEventListener","parsedData","event","manualTraceChild","spanName","msToNs","startTime","endTime","attributes","updatedModules","isPageHidden","hadRuntimeError","dependencyChain","Log","warn","FAST_REFRESH_RUNTIME_RELOAD","Array","isArray","cleanedModulePath","browserDebugInfoInTerminal","receiveBrowserLogsTurbopack","entries","router","sourceType","Error","turbopackConnectedMessage","TURBOPACK_CONNECTED","errors","entryIssues","issue","formatIssue","printNonFatalIssue","devIndicatorServerState","disabledUntil","Date","now","versionInfo","devToolsConfig","getDevToolsConfig","syncMessage","SYNC","warnings","hash","debug","devIndicator","connectReactDebugChannel","action","setReactDebugChannel","debugChannel","htmlRequestId","setHmrServerError","_error","clearHmrServerError","start","getCompilationErrors","appEntryKey","pagesEntryKey","topLevelIssues","thisEntryIssues","formattedIssue","isWellKnownError","invalidate","reloadAfterInvalidation","entrypoint","clearAllModuleContexts","SERVER_COMPONENT_CHANGES","buildFallbackError","inputPage","appPaths","isApp","traceChild","traceAsyncFn","BLOCKED_PAGES","includes","routeDef","findPagePathData","pageExtensions","pagesDir","appDir","globalNotFound","isAppPageRouteDefinition","normalizedPage","normalizeAppPath","matchingAppPaths","pathname","handlePagesErrorRoute","setPathsForKey","clientPaths","isInsideAppDir","bundlePath","isEntryMetadataRouteFile","isMetadataRouteFile","filename","normalizedAppPage","normalizedPageToTurbopackStructureRoute","extname","route","PageNotFoundError","handleRouteType","wsClient","terminate","exit","writeManifests","handleProjectUpdates","updateMessage","updateInfoSubscribe","updateType","BUILDING","addErrors","errorsMap","details","detail","renderStyledStringToErrorAnsi","clientErrors","BUILT","time","value","duration","timeMessage","round"],"mappings":";;;;+BA0KsBA;;;eAAAA;;;0BAzKW;sBACO;qBACV;2DAEf;uBAGuB;kCASM;qBASZ;6DACX;oCAId;2BACuB;qCAIvB;uBAC2B;wBACT;8BACG;8BAIrB;qCAC6B;uBACd;gCAgBf;iCAKA;gCACiC;sCACP;0BAM1B;0BAIA;uCACqC;wCACH;0BACR;wBAEA;iCACG;mCACkB;gDACP;wBASxC;6CACqC;yCACJ;wCACS;4CACH;mCACC;wBACV;6BACO;+BACd;0CAIvB;8BAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEP,MAAMC,WAAW,IAAIC,WAAE,CAACC,MAAM,CAAC;IAAEC,UAAU;AAAK;AAChD,MAAMC,aAAa,CAAC,CAClBC,CAAAA,QAAQC,GAAG,CAACC,cAAc,IAC1BF,QAAQC,GAAG,CAACE,gBAAgB,IAC5BH,QAAQC,GAAG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QAAQ;gCACnBG,MAAMc,6CAA2B,CAAC8N,KAAK;gCACvCxE,MAAMlI,OAAO,EAAE3C;gCACf8J,QAAQ;uCAAIsF,aAAarO,MAAM;iCAAG;gCAClC6J,UAAU,EAAE;4BACd;wBACF;wBAEA,IAAI7K,kBAAkB;4BACpB,MAAMuP,OAAOX,cAAcY,KAAK,CAACC,QAAQ;4BACzC,MAAMC,cACJH,OAAO,OAAO,GAAGrZ,KAAKyZ,KAAK,CAACJ,OAAO,OAAO,GAAG,CAAC,CAAC,GAAG,GAAGA,KAAK,EAAE,CAAC;4BAC/DtG,KAAIX,KAAK,CAAC,CAAC,YAAY,EAAEoH,aAAa;4BACtC1P,mBAAmB;wBACrB;wBACA;oBACF;gBACA;YACF;QACF;IACF;IAEA2O,uBAAuBrH,KAAK,CAAC,CAAC7P;QAC5B8P,QAAQ3K,KAAK,CAACnF;QACd7B,QAAQ6Y,IAAI,CAAC;IACf;IAEA,OAAOnJ;AACT","ignoreList":[0]}
|
@@ -264,7 +264,7 @@ class HotReloaderWebpack {
|
|
264
264
|
this.previewProps = previewProps;
|
265
265
|
this.rewrites = rewrites;
|
266
266
|
this.hotReloaderSpan = (0, _trace.trace)('hot-reloader', undefined, {
|
267
|
-
version: "15.5.1-canary.
|
267
|
+
version: "15.5.1-canary.34"
|
268
268
|
});
|
269
269
|
// Ensure the hotReloaderSpan is flushed immediately as it's the parentSpan for all processing
|
270
270
|
// of the current `next dev` invocation.
|
@@ -82,7 +82,7 @@ function logStartInfo({ networkUrl, appUrl, envInfo, experimentalFeatures, logBu
|
|
82
82
|
bundlerSuffix = ' (webpack)';
|
83
83
|
}
|
84
84
|
}
|
85
|
-
_log.bootstrap(`${(0, _picocolors.bold)((0, _picocolors.purple)(`${_log.prefixes.ready} Next.js ${"15.5.1-canary.
|
85
|
+
_log.bootstrap(`${(0, _picocolors.bold)((0, _picocolors.purple)(`${_log.prefixes.ready} Next.js ${"15.5.1-canary.34"}`))}${bundlerSuffix}`);
|
86
86
|
if (appUrl) {
|
87
87
|
_log.bootstrap(`- Local: ${appUrl}`);
|
88
88
|
}
|
@@ -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.5.1-canary.
|
182
|
+
process.title = `next-server (v${"15.5.1-canary.34"})`;
|
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.5.1-canary.
|
25
|
+
return !((_process_env___NEXT_VERSION = "15.5.1-canary.34") == 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){
|
@@ -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.5.1-canary.
|
14
|
+
if (typeof "15.5.1-canary.34" !== 'string') {
|
15
15
|
return [];
|
16
16
|
}
|
17
17
|
const payload = {
|
18
|
-
nextVersion: "15.5.1-canary.
|
18
|
+
nextVersion: "15.5.1-canary.34",
|
19
19
|
nodeVersion: process.version,
|
20
20
|
cliCommand: event.cliCommand,
|
21
21
|
durationMilliseconds: event.durationMilliseconds,
|