The end token of your here document has trailing whitespace. This is invisible to the naked eye, but shells do not accept it.
It is recommended to remove the trailing whitespace.
"▭" below indicates an otherwise invisible space:
cat << "eof"
Hello
eof▭
cat << "eof"
Hello
eof