"▭" below indicates an otherwise invisible space:
cat << "eof"
Hello
eof▭
cat << "eof"
Hello
eof
The end token of your here document has trailing whitespace. This is invisible to the naked eye, but shells do not accept it.
Remove the trailing whitespace.
None.
ShellCheck is a static analysis tool for shell scripts. This page is part of its documentation.