When attempting to find a candidate for a dynamic import, we should try to find the first candidate that can be resolved; the code was incorrectly trying to resolve the importing module instead of the candidate module.