Jabir bin Abdullah reported,

The Messenger of Allah ﷺ was on a journey when he saw a crowd gathered around a man who was being shaded. He asked, "What is this?"They replied, "He is fasting."He said, "It is not righteousness to fast while traveling."

Bukhari 1946

Sahih

حدثنا آدم حدثنا شعبة حدثنا محمد بن عبد الرحمن الأنصاري قال سمعت محمد بن عمرو بن الحسن بن علي

عن جابر بن عبد الله رضي الله عنهم قال

كان رسول الله ﷺ في سفر فرأى زحاما ورجلا قد ظلل عليه فقال ما هذا فقالوا صائم فقال ليس من البر الصوم في السفر

البخاري 1946صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Fasting
Chapter
His saying to those who shaded him when the heat was intense, "It is not righteousness to fast while traveling"
Numbering
Darussalam 1946
Bukhari 1946