Rhino compiler can fail to compile modules if default charset is not UTF-8
jochenberger opened this issue · comments
The problem is in https://github.com/apache/tapestry-5/blob/5.4.1/tapestry-webresources/src/main/java/org/apache/tapestry5/internal/webresources/RhinoExecutorPool.java#L146, which creates a Reader
without specifying a Charset
. This causes trouble on Windows machines when trying to read the browser.js
bundle, which contains unicode characters.
Error message:
017-01-09 14:55:35,224 [pool-3-thread-3] ERROR o.a.t.i.Registry - SyntaxError: Invalid range in character class. (classpath:de/eddyson/tapestry/react/services/browser.js#490)
2017-01-09 14:55:35,224 [pool-3-thread-3] ERROR o.a.t.i.Registry - Operations trace:
2017-01-09 14:55:35,225 [pool-3-thread-3] ERROR o.a.t.i.Registry - [ 1] Compiling classpath:XXX from JSXM to JavaScript
2017-01-09 14:55:35,225 [pool-3-thread-3] ERROR o.a.t.i.Registry - [ 2] Creating Rhino executor for source(s) classpath:de/eddyson/tapestry/react/services/browser.js.
2017-01-09 14:55:35,225 [pool-3-thread-3] ERROR o.a.t.i.Registry - [ 3] Loading script classpath:de/eddyson/tapestry/react/services/browser.js.
2017-01-09 14:55:35,231 [pool-3-thread-3] ERROR d.e.t.m.M.MinificationCacheWarming - Error requesting minified stack XXX for locale XXX
org.apache.tapestry5.ioc.internal.OperationException: SyntaxError: Invalid range in character class. (classpath:de/eddyson/tapestry/react/services/browser.js#490)
I wish I could test this, but I cannot get the project to build on Windows, neither in a command prompt not in cygwin or git bash. There seems to be something wrong with browserify, but I lack the time and motivation to dig into this now.