From 75131b9af1a5432c9692785fc69ab611bc0206af Mon Sep 17 00:00:00 2001 From: SukkaW Date: Tue, 4 Jun 2024 14:11:17 +0800 Subject: [PATCH] fix: properly patch lockfile against swc bindings --- packages/next/src/lib/patch-incorrect-lockfile.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/next/src/lib/patch-incorrect-lockfile.ts b/packages/next/src/lib/patch-incorrect-lockfile.ts index bee374d8d90..b7678884f7f 100644 --- a/packages/next/src/lib/patch-incorrect-lockfile.ts +++ b/packages/next/src/lib/patch-incorrect-lockfile.ts @@ -56,7 +56,9 @@ export async function patchIncorrectLockfile(dir: string) { const lockfileParsed = JSON.parse(content) const lockfileVersion = parseInt(lockfileParsed?.lockfileVersion, 10) - const expectedSwcPkgs = Object.keys(nextPkgJson['optionalDependencies'] || {}) + const expectedSwcPkgs = Object.keys( + nextPkgJson['optionalDependencies'] || {} + ).filter((pkg) => pkg.startsWith('@next/swc-')) const patchDependency = ( pkg: string,