re-frame-10x icon indicating copy to clipboard operation
re-frame-10x copied to clipboard

Handle preloading when script is in the head

Open danielcompton opened this issue 7 years ago • 0 comments

If the ClojureScript script file is loaded in the <head>, then it will run before the document is loaded, and you get the error message:

Uncaught TypeError: Cannot read property 'appendChild' of null
    at day8$re_frame$trace$panel_div (trace.cljs:222)
    at day8$re_frame$trace$inject_devtools_BANG_ (trace.cljs:229)
    at preload.cljs:11

I'm not sure what the best approach is to handle this. https://stackoverflow.com/questions/9916747/why-is-document-body-null-in-my-javascript has more info on this.

danielcompton avatar Feb 14 '18 08:02 danielcompton