boot-clj / boot-cljs

Boot task to compile ClojureScript programs.
Eclipse Public License 1.0
176 stars 40 forks source link

New asset-path default causing problems on Node #170

Open Deraen opened 7 years ago

Deraen commented 7 years ago

https://github.com/anmonteiro/lumo had problems with Boot-cljs 2.1

❯ boot test
Compiling ClojureScript...
• lumo_test/test_suite.js

;; ======================================================================
;; Testing with Node:

module.js:487
    throw err;
    ^

Error: Cannot find module '/home/juho/.boot/cache/tmp/home/juho/Source/lumo/a6t/3lgroc/lumo_test/lumo_test/test_suite.out/goog/bootstrap/nodejs.js'

Previously the default asset-path happened to be correct, due to bug in Boot-cljs: https://github.com/boot-clj/boot-cljs/pull/156 Also related: https://github.com/boot-clj/boot-cljs/commit/3cd71952e55a9d5717a5f190409ee50d3c2d6051

Manually setting :asset-path on boot-cljs-test fixes this. There might be bug at boot-cljs-test code: https://github.com/crisptrutski/boot-cljs-test/blob/master/src/crisptrutski/boot_cljs_test/utils.clj#L101 But there could be something wrong with boot-cljs test also as this broke between 2.0 and 2.1.

Deraen commented 7 years ago

This does work:

(deftask test-node []
  (testing)
  (cljs :compiler-options {:optimizations :none
                           :main 'lumo.test-runner
                           :verbose true
                           ; :asset-path "main.out"
                           :compiler-stats true
                           :target :nodejs}) )
Deraen commented 7 years ago

Breaks PhantomJS also:

~/Source/metosin/metosin-common master* 19s
❯ boot run-tests
Compiling ClojureScript...
• cljs_test/generated_test_suite.js

;; ======================================================================
;; Testing with Phantom:

ClojureScript could not load :main, did you forget to specify :asset-path?
ReferenceError: Can't find variable: goog