The case of dynamically importing from a fragment was not correctly handled when we previously refactored the code so that we don't synthesize capabilities for attached fragments on the host. I refactored this code to avoid duplication and to ensure that the normal path and the dynamic import path are resolved the same way. (FELIX-2950)