For posterity, I looked through my template several times, especially around where the compiler said the error was, the issue was actually that I did not close the <script> tag.
<script>