E0009 Script block after markup
Why
A page's script block sits between two --- lines at the very top of the file. Only a byte order mark and whitespace may come before it; anywhere else the fence and the script would be read as text.
How to fix it
Move the script block, with both --- lines, to the top of the file.
In a terminal
duolith explain E0009