Office 365 – PnP – Exporting sites with welcome pages not set to a page

Today I tried to export a site as a PnP template and I was getting an annoying error: Get-PnPProvisioningTemplate : Cannot invoke method or retrieve property from null object. Object … read the office-365-pnp-exporting-sites-with-welcome-pages-not-set-to-a-page post