diff --git a/src/plugins/provider-public-artifacts.ts b/src/plugins/provider-public-artifacts.ts index b0889a29b6c..17fb8e4e59a 100644 --- a/src/plugins/provider-public-artifacts.ts +++ b/src/plugins/provider-public-artifacts.ts @@ -102,10 +102,13 @@ export function resolveBundledProviderPolicySurface( if (!normalizedProviderId) { return null; } - return ( - tryLoadBundledProviderPolicySurface(normalizedProviderId) ?? - tryLoadBundledProviderPolicySurface( - resolveBundledProviderPolicyPluginId(normalizedProviderId, options) ?? normalizedProviderId, - ) - ); + const directSurface = tryLoadBundledProviderPolicySurface(normalizedProviderId); + if (directSurface) { + return directSurface; + } + const ownerPluginId = resolveBundledProviderPolicyPluginId(normalizedProviderId, options); + if (!ownerPluginId || ownerPluginId === normalizedProviderId) { + return null; + } + return tryLoadBundledProviderPolicySurface(ownerPluginId); }