Syntax errors are detected in generated GRUB config file after update

I ran yay just now and got this at the end:

error: out of memory.
error: syntax error.
error: Incorrect command.
error: syntax error.
Syntax error at line 142
Syntax errors are detected in generated GRUB config file.
Ensure that there are no errors in /etc/default/grub
and /etc/grub.d/* files or please file a bug report with
/boot/grub/grub.cfg.new file attached.
error: command failed to execute correctly

Here is the result of

cat /boot/grub/grub.cfg | eos-sendlog

http://ix.io/4GmY

sudo parted -l

http://ix.io/4Gnm

Update: I looked at line 142 of all the files in the suggested folders but I couldn’t see anything wrong. I have no experience with this type of stuff, so I was looking for incorrect brackets to be fair. I also searched online for possible solutions but it seems like this problem is resolved differently in every case. Looking at /boot/grub/grub.cfg also didn’t reveal anything, but it is mostly incomprehensible to me.

Can you share the output of ls /etc/grub.d

here it is:

ls /etc/grub.d
00_header  20_linux_xen  30_os-prober      35_fwupd   41_custom           45_eos_windows
10_linux   25_bli        30_uefi-firmware  40_custom  41_snapshots-btrfs  README

Can you also share the contents of /boot/grub/grub.cfg.new

This one is a bit strange. I tried sharing its contents in the original post as well, but I get this:

sudo cat /boot/grub/grub.cfg.new | eos-sendlog
cat: /boot/grub/grub.cfg.new: No such file or directory
==> eos-sendlog: warning: nothing to send.

How about pacman -Qo /etc/grub.d/*

pacman -Qo /etc/grub.d/*
/etc/grub.d/00_header is owned by grub 2:2.12rc1-1
/etc/grub.d/10_linux is owned by grub 2:2.12rc1-1
/etc/grub.d/20_linux_xen is owned by grub 2:2.12rc1-1
/etc/grub.d/25_bli is owned by grub 2:2.12rc1-1
/etc/grub.d/30_os-prober is owned by grub 2:2.12rc1-1
/etc/grub.d/30_uefi-firmware is owned by grub 2:2.12rc1-1
/etc/grub.d/35_fwupd is owned by fwupd 1.9.5-2
/etc/grub.d/40_custom is owned by grub 2:2.12rc1-1
/etc/grub.d/41_custom is owned by grub 2:2.12rc1-1
/etc/grub.d/41_snapshots-btrfs is owned by grub-btrfs 4.13-1
error: No package owns /etc/grub.d/45_eos_windows
/etc/grub.d/README is owned by grub 2:2.12rc1-1

What does sudo pacman -Qkk grub grub-btrfs fwupd return?

sudo pacman -Qkk grub grub-btrfs fwupd

backup file: grub: /etc/default/grub (Modification time mismatch)
backup file: grub: /etc/default/grub (Size mismatch)
backup file: grub: /etc/default/grub (MD5 checksum mismatch)
backup file: grub: /etc/default/grub (SHA256 checksum mismatch)
grub: 1119 total files, 0 altered files
grub-btrfs: 30 total files, 0 altered files
fwupd: 3878 total files, 0 altered files

That looks fine. Can you ahre the contents of /etc/default/grub

These mismatches are not a problem?

Here are the contents of /etc/default/grub

http://ix.io/4GEO

No, that just means the file has been modified which we do as part of the installation.