day8 / re-frame-10x

A debugging dashboard for re-frame. X-ray vision as tooling.
MIT License
634 stars 68 forks source link

Handle preloading when script is in the head #153

Closed danielcompton closed 1 year ago

danielcompton commented 6 years ago

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.

kimo-k commented 1 year ago

Anyone have a use-case in mind for loading in the head?

Maybe it has to do with measure app, but I'm not sure what that is, or what's generally being discussed there.

kimo-k commented 1 year ago

Closing for now, due to missing context.