Marin Cilic, the 2014 U.S. Open champion who lost to Federer in the final of this year's Australian Open, eased to a 7-5, 6-3 victory over Marton Fucsovics.
His title defence got off to a soggy start on Saturday night when play was suspended because of rain showers with Federer up a set and tied 2-2 in the second.
Federer admitted that his quick turnaround from the previous match and an early afternoon start produced a brief obstacle.
Federer, who took over from Rafael Nadal as the top ranked ATP men's singles player in February, needs to make, at least, the semi-finals in order to remain at the summit.
20-times Grand Slam victor Federer is chasing a sixth title at the event, and will take some stop judging by the manner in which he swatted aside his 26-year-old opponent in only 58 minutes.
After his defeat, a bemused Djokovic said: "It felt like the first match I have ever played on the tour, very weird. I just completely lost rhythm, everything, struggled a little bit with the health the last couple of weeks".
The 12-time Grand Slam champion was playing his first competitive match since recovery from a wrist injury that hampered his Australian Open campaign in January 2018.More news: Aqib Talib rejected trade to 49ers before being dealt to Rams
"And even though you don't have pain, you're still thinking about it, because it's been something that I have been feeling and dragging for over two years".
Djokovic bounced back in the second, but Daniel took advantage of his opponent's poor form to win the third.
"I haven't really checked out my draw entirely", he said.
"It is still early stages for Novak coming back and the first one after surgery. He's only going to get better from here", concluded the world number one.
Federer served six aces and broke the Krajinovic serve five times.
In other action, Croatian Borna Coric defeated 13th seed Roberto Bautista Agut 6-1, 6-3.
Caroline Garcia also progressed in straight sets against Daria Gavrilova.