question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Uncaught TypeError" on getting body style!

See original GitHub issue

Hi, there is a bug "Uncaught TypeError: Cannot read property ‘style’ of null " on this line ; @216 // Sniff on document.body.style var bodyStyle = document.body.style;

Issue Analytics

  • State:open
  • Created 10 years ago
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
gujimancommented, Jan 18, 2018

if you place it at the top then you can do something like:

        var ngProgRun = setInterval(function () {
              if (document.body != null) {
                    clearInterval(ngProgRun);
                    NProgress.start();
              }
        }, 10);
0reactions
ricardocommented, Oct 19, 2017

You are probably placing the script inside the head tag. Try inserting the start() inside the body tag instead.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Javascript, getElementById and style not working: Uncaught ...
Move my code to the bottom of the page, but now I get a new error `Uncaught TypeError: Property 'display' of object #<CSSStyleDeclaration>...
Read more >
How to get content from the editor and set content | TinyMCE
This article also explains how to fix errors and troubleshoot if you're finding get content and set content aren't working.
Read more >
Uncaught TypeError: $ is not a function
I just tried using sideNav, but i get this error in the console, and the navbar does ... mdb.min.js:36 Uncaught TypeError: $ is...
Read more >
Uncaught Type Error: cant set innerHTML of null? - Treehouse
A common solution from StackOverflow is to place the script tag just right before </body>/. I have already done this and still get...
Read more >
Modifying the document - The Modern JavaScript Tutorial
There's a special method append for that: document.body.append(div) . Here's the full code: <style> .alert { padding: 15px; ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found