It used to be the norm for companies to become profitable, then IPO, moreso for megacorps.
If I am remembering my history correctly, the first company to go public with a multi-billion dollar valuation while being unprofitable was Netscape, which kicked off the dotcom bubble.