{"record":{"id":"4b63b30ff541bcdb","repo":"vercel/next.js","slug":"found-lockfile-missing-swc-dependencies","errorCode":null,"errorMessage":"Found lockfile missing swc dependencies,","messagePattern":"Found lockfile missing swc dependencies,","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/next/src/lib/patch-incorrect-lockfile.ts","lineNumber":139,"sourceCode":"\n      if (!pkgPrefix) {\n        // unable to locate the next package so bail\n        return\n      }\n    }\n\n    for (const pkg of expectedSwcPkgs) {\n      if (\n        (shouldPatchDependencies && !lockfileParsed.dependencies[pkg]) ||\n        (shouldPatchPackages && !lockfileParsed.packages[`${pkgPrefix}${pkg}`])\n      ) {\n        missingSwcPkgs.push(pkg)\n      }\n    }\n    if (missingSwcPkgs.length === 0) {\n      return\n    }\n    Log.warn(\n      `Found lockfile missing swc dependencies,`,\n      isCI ? 'run next locally to automatically patch' : 'patching...'\n    )\n\n    if (isCI) {\n      // no point in updating in CI as the user can't save the patch\n      return\n    }\n    const pkgsData = await Promise.all(\n      missingSwcPkgs.map((pkg) => fetchPkgInfo(pkg))\n    )\n\n    for (let i = 0; i < pkgsData.length; i++) {\n      const pkg = missingSwcPkgs[i]\n      const pkgData = pkgsData[i]\n\n      if (shouldPatchDependencies) {\n        patchDependency(pkg, pkgData)","sourceCodeStart":121,"sourceCodeEnd":157,"githubUrl":"https://github.com/vercel/next.js/blob/0eb377541648e63402a47b38fee00a8d0ce8f8f1/packages/next/src/lib/patch-incorrect-lockfile.ts#L121-L157","documentation":"patchIncorrectLockfile compares the parsed lockfile against the expected @next/swc platform packages; when entries are missing it warns, then either patches the lockfile automatically when run locally or, on CI, instructs the user to run next locally so it can patch.","triggerScenarios":"Thrown at packages/next/src/lib/patch-incorrect-lockfile.ts:139 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Run install again so the lockfile can be patched and @next/swc platform dependencies downloaded."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0eb377541648e63402a47b38fee00a8d0ce8f8f1","analyzedAt":"2026-08-19T02:10:13.922Z","contentChangedAt":"2026-08-19T02:10:13.922Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}