Skip to content

Commit 2b195bd

Browse files
committed
Change error to warn for pnpm-lock format
1 parent 5cee212 commit 2b195bd

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

apps/lockfile-explorer/src/graph/lfxGraphLoader.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ import * as lockfilePath from './lockfilePath';
2121
type PnpmLockfileVersion = 54 | 60 | 90;
2222
type PeerDependenciesMeta = lockfileTypes.LockfilePackageInfo['peerDependenciesMeta'];
2323

24+
let hasWarnedAboutOutdatedFormat: boolean = false;
25+
2426
function createPackageLockfileDependency(options: {
2527
name: string;
2628
versionPath: string;
@@ -329,9 +331,16 @@ function createPackageLockfileEntry(options: {
329331
slashlessRawEntryId = rawEntryId;
330332
} else {
331333
if (!rawEntryId.startsWith('/')) {
332-
throw new Error('Expecting leading "/" in path: ' + JSON.stringify(rawEntryId));
334+
if (!hasWarnedAboutOutdatedFormat) {
335+
console.warn(
336+
'Your pnpm-lock.yaml contains outdated version formats. Please run "rush update --full" to fix this issue.'
337+
);
338+
hasWarnedAboutOutdatedFormat = true;
339+
}
340+
slashlessRawEntryId = rawEntryId;
341+
} else {
342+
slashlessRawEntryId = rawEntryId.substring(1);
333343
}
334-
slashlessRawEntryId = rawEntryId.substring(1);
335344
}
336345

337346
let dotPnpmSubfolder: string;

0 commit comments

Comments
 (0)