Open PrzemyslawKlys opened 3 years ago
This is happening because Kineto tries to check availability of certain web APIs that it relies onto, making use of document.body
. This process runs synchronous as of now — if you load the script from head
tag, the engine will invoke Kineto's initialization function before the body
tag is ever being parsed by the browser, which would throw the ReferenceError you have described above.
I understand some developers prefer placing their dependencies in the head
rather than the body
— I will make changes to the library soon so that it can acheive the same steps but asynchronously to give users more freedom in placing the script.
I've very small example: https://codepen.io/MadBoyEvo/pen/XWNMVqj
This example works just fine.
If I copy/paste this example into .HTML file and just open it up locally
With errors:
If I move
to line 209 (so just inside body tag) it starts to work just fine. Why would behavior for local files be different than for hosted files?