Error reading file /etc/network/interfaces: unexpected line 'source-directory /etc/network/interfaces.d'

As information only, I’ve a fresh Debian 11 installation from August 2022 and also I had the below lines

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

# Cloud images dynamically generate config fragments for newly
# attached interfaces. See /etc/udev/rules.d/75-cloud-ifupdown.rules
# and /etc/network/cloud-ifupdown-helper. Dynamically generated
# configuration fragments are stored in /run:
source-directory /run/network/interfaces.d

I solved the problems with Dashboard by changing it to one line with

source /run/network/interfaces.d/*