Closed shen-tian closed 7 years ago
Thanks, @shen-tian. As discussed in Slack, it looks like a Jetty configuration issue. The instant workaround is using httpkit, which seems to default to serving content as UTF-8. I'll look into whether Jetty can be configured by boot-http to default to that charset, as well.
Ran into the same issue with plotlyjs, this PR fixes the issue for me: https://github.com/pandeiro/boot-http/pull/62
Fixed in 0.8.2
Not sure if it's
boot-http
issue or one of its dependencies, but it's not serving JavaScript files with non-ASCII chars correctly. When it tries to do so, with the required<meta charset="UTF-8">
in the HTML, it yields aUncaught SyntaxError: Invalid or unexpected token
error.I've reproduced the issues here. Trivial example, using an untouched copy of
plotly.js
(which uses the greek letters for pi and epsilon as variable names) and a minimal HTML file. It servers correctly with Python'sSimpleHTTPServer
but notboot-http
.Seems it's similar to this issue with figwheel? I've had a look through the source, but couldn't determine where the issue is.
I came across this while working on a ClojureScript page using cljsjs/plotly.