if data is undefined or null in the Message payload in this file node_modules/firebase_admin/lib/messaging/messaging.js line: 670 will return the error in forEach
if ('data' in payloadCopy) {
messaging_internal_1.BLACKLISTED_DATA_PAYLOAD_KEYS.forEach((blacklistedKey) => {
.
.
.
}
must add null check;