-
Notifications
You must be signed in to change notification settings - Fork 684
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
document.body.style called before body exists #38
Comments
thanks for reporting, yeah in general you should use defer until the body exists, you can either include the script after the body is loaded or examples should be fixed by me but i'm super lazy :P |
I still get this error, how come the issue is closed? |
Hi there, I still get this error : "Uncaught TypeError: Cannot read property 'style' of null " at the exact same line specified above. Is there any fix ? Thanks, |
@hems @Loris1634 can you guys come up with a tiny html file that reproduces it ? |
Yep. Here it is : http://pastebin.com/2UYcwjsB I was not really accurate earlier. Here is the exact error I get : TypeError: document.body is null move.js:284 (I am using Firefox) |
To solve this error, just put move.js before |
@felquis some people don't include the js on the html source.. |
Hey, we just encountered this bug in the nastiest of ways: Our module is loaded in the head but MoveJS is only invoked later on runtime. This resulted in a race condition where we would function normally most of the time, but if we loaded faster than the dom we would get this error. We would like to issue a pull request to at least workaround this issue. Perhaps an optional flag to skip to document.body.style check. What do you think? |
I have same issue. :( |
Uncaught TypeError: Cannot read property 'style' of null
... Move is initialized before body exists. There are workarounds... non of which should be necessary.
Line 284
var styl = document.body.style;
The text was updated successfully, but these errors were encountered: