adzerk-oss / boot-reload

Boot task providing live-reload of browser css, images, etc.
Eclipse Public License 1.0
87 stars 35 forks source link

Closure library deleted goog.net.jsloader.load #121

Closed grinderrz closed 6 years ago

grinderrz commented 7 years ago

Which results in

cljs.user=> (require '[my.namespace :as l] :reload)
#object[TypeError TypeError: goog.net.jsloader.load is not a function]

TypeError: goog.net.jsloader.load is not a function
    at adzerk.boot_reload.client.patch_goog_base_BANG_.goog.global.CLOSURE_IMPORT_SCRIPT (ht
tp://localhost:3000/js/main.out/adzerk/boot_reload/client.js:18:26)
    at Object.goog.importScript_ (http://localhost:3000/js/main.out/goog/base.js:951:9)
    at Object.goog.writeScripts_ (http://localhost:3000/js/main.out/goog/base.js:1394:16)
    at Object.goog.require [as require__] (http://localhost:3000/js/main.out/goog/base.js:70
6:14)
    at Object.clojure.browser.repl.bootstrap.goog.require (http://localhost:3000/js/main.out
/clojure/browser/repl.js:295:16)
    at eval (eval at <anonymous> (http://localhost:3000/js/main.out/weasel/repl.js:30:495),
<anonymous>:1:6)
    at http://localhost:3000/js/main.out/weasel/repl.js:30:495
    at http://localhost:3000/js/main.out/weasel/repl.js:39:4
    at cljs.core.MultiFn.G__12183__2 (http://localhost:3000/js/main.out/cljs/core.js:34490:1
06)
    at cljs.core.MultiFn.G__12183 [as call] (http://localhost:3000/js/main.out/cljs/core.js:
34757:20)

According this commit, one should use .safeLoad instead.

Deraen commented 7 years ago

This was fixed in 0.5.2.

grinderrz commented 7 years ago

Experiencing this on 0.5.2 now. As I understand, there was fixed a similar issue #117 with .loadMany Call to .load is still here

Kpovoc commented 7 years ago

I am also having a similar error, and can confirm that the following from client.cljs seems to be the trouble code.

; Thanks, lein-figwheel & lively!
(defn patch-goog-base! []
  (set! (.-provide js/goog) (.-exportPath_ js/goog))
  (set! (.-CLOSURE_IMPORT_SCRIPT (.-global js/goog)) (fn [file]
                                                       (when (.inHtmlDocument_ js/goog)
                                                         (jsloader/load file)))))

Edited to provide my error:

#object[TypeError TypeError: goog.net.jsloader.load is not a function]
TypeError: goog.net.jsloader.load is not a function
    at adzerk.boot_reload.client.patch_goog_base_BANG_.goog.global.CLOSURE_IMPORT_SCRIPT (http://localhost:3000/js/main.out/adzerk/boot_reload/client.js:18:26)
    at Object.goog.importScript_ (http://localhost:3000/js/main.out/goog/base.js:951:9)
    at Object.goog.writeScripts_ (http://localhost:3000/js/main.out/goog/base.js:1394:16)
    at Object.goog.require [as require__] (http://localhost:3000/js/main.out/goog/base.js:706:14)
    at Object.clojure.browser.repl.bootstrap.goog.require (http://localhost:3000/js/main.out/clojure/browser/repl.js:295:16)
Deraen commented 7 years ago

Does this happen when using repl?

Kpovoc commented 7 years ago

Yes. I'm working through modern-cljs, and the error occurs with this call:

cljs.user=> (require '[modern-cljs.login :as l] :reload)
oakes commented 7 years ago

FWIW this seemed to happen to me when I tried directly running client/connect at the top level of an ns that was in my :preloads. When I moved it into my window.onload function, the problem went away. Not sure what to make of that, but hopefully it helps.

NOBLES5E commented 6 years ago

Also experiencing this

Deraen commented 6 years ago

https://github.com/adzerk-oss/boot-reload/pull/122 has been merged and released in 0.6.0