Roots Discourse

Stumped by - SyntaxError: "" literal not terminated before end of script message

I’m running yarn build:production without any errors or issues, I upload the dist folder to my production site and I get a console error of SyntaxError: "" literal not terminated before end of script on my main.js file but only on my production site! Obviously the site breaks completely at this point.

I upload exactly the same dist folder to my staging site, which is to all intents and purposes exactly the same site - same plugins, config, everything - no errors at all and site is fine! What on earth is going on?? Any ideas or help here gratefully received!

By the way, I’ve done the obvious - rebuilt using just yarn build and cleared all cache/cookies etc. Same on Firefox and Chrome!

The error in developer console tab should also indicate in what file this error happened.
In Chrome the file is also a link that can be opened so you can see the actual contents of the script file.
Maybe something went wrong with the transfer of the theme build artifacts to production or encoding (or maybe even gzip)?

This topic was automatically closed after 42 days. New replies are no longer allowed.