Craft 3 Template - Getting Image URLs
Something like this should do it:

{% set heroImage = entry.heroImage.one().getUrl() %}


Although this probably works as well:

{% set heroImage = entry.heroImage.one().url %}


In Craft 3, .first() has been replaced with .one().  https://docs.craftcms.com/v3/changes-in-craft-3.html#query-methods