Function fails when used in precompile workload

I changed the function to:

function str2type(name)
    typename = Symbol(name)
    t = getfield(FLORIDyn, typename)
    instance = t()
end

And now all works fine!

Thank you!