Skip to content

Commit 925a1eb

Browse files
committed
solution to cli issue TypeError: Cannot read properties of undefined (reading 'fsPath') #895
1 parent 9ba1fda commit 925a1eb

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/spec-configuration/lockfile.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export async function writeLockfile(params: ContainerFeatureInternalParams, conf
6767
return;
6868
}
6969

70-
export async function readLockfile(config: DevContainerConfig): Promise<{ lockfile?: Lockfile; initLockfile?: boolean }> {
70+
export async function readLockfile(config: DevContainerConfig | string): Promise<{ lockfile?: Lockfile; initLockfile?: boolean }> {
7171
try {
7272
const content = await readLocalFile(getLockfilePath(config));
7373
// If empty file, use as marker to initialize lockfile when build completes.

src/spec-node/featuresCLI/resolveDependencies.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ async function featuresResolveDependencies({
8484
env: process.env,
8585
};
8686

87-
const { lockfile } = await readLockfile(config);
87+
let configObj: DevContainerConfig | string = config.hasOwnProperty('configFilePath') && config.configFilePath ? config : configPath;
88+
89+
const { lockfile } = await readLockfile(configObj);
8890
const processFeature = async (_userFeature: DevContainerFeature) => {
8991
return await processFeatureIdentifier(params, configPath, workspaceFolder, _userFeature, lockfile);
9092
};

0 commit comments

Comments
 (0)