React Static – Unexpected token error in head script [duplicate]

I have a React Static site and within the static.config.js file I am trying to add a script to the head element. I have boiled my issue down to the following simple example.

enter image description here

When I spin up the site locally I see the following error in my DevTools:

enter image description here

enter image description here

Why is this error occurring and how do I resolve it to successfully log to the console?