electron-and-clojurescript icon indicating copy to clipboard operation
electron-and-clojurescript copied to clipboard

electron-packager not working

Open sihingkk opened this issue 8 years ago β€’ 3 comments

Hey,

after downloading your repo, setting optimalisations to :none and making

boot build-prod
electron-packager target/ MyApp --platform=darwin --arch=x64 --version=0.31.2
open MyApp-darwin-x64/MyApp.app

I'm getting Error: Cannot find module '/main.out/goog/bootstrap/nodejs.js'

and it’s because there is main.js generated which use

require(path.join(path.resolve("."),"app/main.out","goog","bootstrap","nodejs.js"));

to require files. the problem is path.resolve(”.”) evaluates to / for build electron process (https://github.com/clojure/clojurescript/blob/cdaeff298e0f1d410aa5a7b6860232270d287084/src/main/clojure/cljs/closure.clj#L1405).

How you package production app? does it working for you?

sihingkk avatar Jan 28 '17 14:01 sihingkk

Same here

pbaille avatar Jan 28 '17 19:01 pbaille

Is there an "elegant" way to apply the fix by @olegakbarov on the generated main.js instead of applying it upstream to clojurescript?

jaromil avatar Apr 14 '18 09:04 jaromil

@jaromil when it comes to elegance you can't beat this: boot prod-build && sed -i '' 's/"."/__dirname/g' target/main.js

olegakbarov avatar Apr 14 '18 10:04 olegakbarov