vercel/next.js · error
Found lockfile missing swc dependencies,
Error message
Found lockfile missing swc dependencies,
What it means
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.
Source
Thrown at packages/next/src/lib/patch-incorrect-lockfile.ts:139
if (!pkgPrefix) {
// unable to locate the next package so bail
return
}
}
for (const pkg of expectedSwcPkgs) {
if (
(shouldPatchDependencies && !lockfileParsed.dependencies[pkg]) ||
(shouldPatchPackages && !lockfileParsed.packages[`${pkgPrefix}${pkg}`])
) {
missingSwcPkgs.push(pkg)
}
}
if (missingSwcPkgs.length === 0) {
return
}
Log.warn(
`Found lockfile missing swc dependencies,`,
isCI ? 'run next locally to automatically patch' : 'patching...'
)
if (isCI) {
// no point in updating in CI as the user can't save the patch
return
}
const pkgsData = await Promise.all(
missingSwcPkgs.map((pkg) => fetchPkgInfo(pkg))
)
for (let i = 0; i < pkgsData.length; i++) {
const pkg = missingSwcPkgs[i]
const pkgData = pkgsData[i]
if (shouldPatchDependencies) {
patchDependency(pkg, pkgData)View on GitHub (pinned to 0eb3775416)
Solutions
- Run install again so the lockfile can be patched and @next/swc platform dependencies downloaded.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at packages/next/src/lib/patch-incorrect-lockfile.ts:139 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of vercel/next.js@0eb3775416 (2026-08-19).
Data as JSON: /api/errors/4b63b30ff541bcdb.
Report an issue: GitHub.