Skip to content

Commit 90ef3cd

Browse files
authored
fix(deps): fallback to unversioned env path for root component dir (#10125)
1 parent 9c0a6a7 commit 90ef3cd

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

scopes/dependencies/dependency-resolver/dependency-resolver.main.runtime.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,8 +572,14 @@ export class DependencyResolverMain {
572572
}
573573
) {
574574
const envId = this.envs.getEnvId(component);
575+
const envIdWithoutVersion = ComponentID.fromString(envId).toStringWithoutVersion();
575576
const rootComponentsRelativePath = relative(options.workspacePath, options.rootComponentsPath);
576-
return getRootComponentDir(rootComponentsRelativePath ?? '', envId);
577+
const rootComponentDirWithVersion = getRootComponentDir(rootComponentsRelativePath ?? '', envId);
578+
const rootComponentDirWithoutVersion = getRootComponentDir(rootComponentsRelativePath ?? '', envIdWithoutVersion);
579+
if (fs.pathExistsSync(rootComponentDirWithoutVersion)) {
580+
return rootComponentDirWithoutVersion;
581+
}
582+
return rootComponentDirWithVersion;
577583
}
578584

579585
/**

0 commit comments

Comments
 (0)