Freemaker templates render variables with the following syntax: ${name}
Javascript ES6 template strings have a similar syntax ${name}
The problem is that when freemarker runs on the server, it will try to render the templates in the javascript code, because Freemarker thinks that it has encountered a variable (when in fact it is a javascript template that should be rendered on the client). Recommnedation on how to handle this?
One way is to wrap all the JS in a freemarker comment (so it is never evaluated),
or put the JS code in a seprate file (not inlined in the html page) so that it is never evaluated by freemarker.