diff --git a/cachi2/core/package_managers/yarn_classic/workspaces.py b/cachi2/core/package_managers/yarn_classic/workspaces.py index 1e3f1f807..ebc5f3912 100644 --- a/cachi2/core/package_managers/yarn_classic/workspaces.py +++ b/cachi2/core/package_managers/yarn_classic/workspaces.py @@ -76,7 +76,14 @@ def _extract_workspaces_globs( package: dict[str, Any], ) -> list[str]: """Extract globs from workspaces entry in package dict.""" + # This could be an Array or an Array nested in an Object. + # Official docs mentioning the former: + # https://classic.yarnpkg.com/lang/en/docs/workspaces/ + # Official blog containing a hint about the latter: + # https://classic.yarnpkg.com/lang/en/docs/workspaces/ workspaces_globs = package.get("workspaces", []) + if isinstance(workspaces_globs, dict): + workspaces_globs = workspaces_globs.get("packages", []) return workspaces_globs