diff --git a/packages/compartment-mapper/src/import-hook.js b/packages/compartment-mapper/src/import-hook.js index fcfc4b5828..c72915d6c3 100644 --- a/packages/compartment-mapper/src/import-hook.js +++ b/packages/compartment-mapper/src/import-hook.js @@ -483,9 +483,9 @@ export function makeImportNowHookMaker( if ('packages' in policy && typeof policy.packages === 'object') { for (const [pkgName, policyItem] of entries(policy.packages)) { if ( - policyItem === true || - (policyItem === DYNAMIC_POLICY_VALUE && - !(pkgName in compartmentDescriptor.modules)) + !(pkgName in compartmentDescriptor.modules) && + pkgName in compartmentDescriptor.scopes && + policyItem ) { compartmentDescriptor.modules[pkgName] = compartmentDescriptor.scopes[pkgName];