Put dynamic imports in the invariant code itself to allow for serialization