Bug report about minifyJs in PosRestStore

In PopRestStore-> build.gradle, in task combineBaseJs ,The line

             destFile.append(file(it).getText("UTF-8"))

should be

            destFile.append(file(it).getText("UTF-8"), "UTF-8")

Otherwise on windows, the created combined.js file would be encoded in ANSI, then cause minifyCombined task fails with error:

PS D:\MoquiDemo-3.0.0> .\gradlew run

> Task :runtime:component:PopRestStore:minifyCombined
ERROR - [JSC_READ_ERROR] Cannot read file D:/MoquiDemo-3.0.0/runtime/component/PopRestStore/screen/store/components/combined.js: Failed to read: D:\MoquiDemo-3.0.0\runtime\component\PopRestStore\screen\store\components\combined.js, is this input UTF-8 encoded?

1 error(s), 0 warning(s)
Error: Cannot read file D:/MoquiDemo-3.0.0/runtime/component/PopRestStore/screen/store/components/combined.js: Failed to read: D:\MoquiDemo-3.0.0\runtime\component\PopRestStore\screen\store\components\combined.js, is this input UTF-8 encoded? at  line -1:-1
Js Minifier: 1 error(s), 0 warning(s)```

Have a nice day
1 Like

Thanks for reporting this, the code is similar in 2 places in the build.gradle file for the webroot component (in the moqui-runtime repo). I just pushed changes to PopRestStore and moqui-runtime based on your recommendation. I haven’t tested this on Windows, if you could do that it would be helpful.

1 Like

I got no problem with webroot component, only PopRestStore. I looked at the code in Webroot, did not have a clue of what make this difference.

Anyway, in PopRestStore, the code has been tested and it went ok without any errors.

Thanks .

1 Like