Cannot read property 'querySelectorAll' of null
See original GitHub issueIt’s really strange, chartist was working fine for me a few days ago but suddenly nothing works.
I copy pasted most of the below code from the official website, so I don’t think the error is on my part, but I can’t be sure.
I’m getting the same error on all browsers, on both minified and unminified versions of chartist, and on both npm and CDN versions of chartist.
index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Data Chart</title>
<link rel="stylesheet" href="//cdn.jsdelivr.net/chartist.js/latest/chartist.min.css">
<script src="//cdn.jsdelivr.net/chartist.js/latest/chartist.min.js"></script>
<script src="chart.js"></script>
</head>
<body>
<div class="ct-chart ct-perfect-fourth"></div>
</body>
</html>
chart.js
var data = {
// A labels array that can contain any sort of values
labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'],
// Our series array that contains series objects or in this case series data arrays
series: [
[5, 2, 4, 2, 0]
]
};
// Create a new line chart object where as first parameter we pass in a selector
// that is resolving to our chart container element. The Second parameter
// is the actual data object. As a third parameter we pass in our custom options.
new Chartist.Bar('.ct-chart', data);
Issue Analytics
- State:
- Created 8 years ago
- Comments:5
Top Results From Across the Web
Cannot read property 'querySelector' of null - Stack Overflow
I am using Cordova app in Visual Studio 2015. I have added a simple button which changes the color of background of app...
Read more >Cannot read property 'querySelectorAll' of null - Laracasts
Uncaught TypeError : Cannot read property 'querySelectorAll' of null. Hi there, I am getting an error in my jQuery code and I don't...
Read more >Cannot read property 'querySelector' of null -- No idea why
What this is telling you is that there is no 'querySelector' method on a null object. The object that it is trying to...
Read more >Uncaught type error: cannot read property 'queryselector' of null
Solution would be validating for null values before accessing the functions in it. but you will only have to trace the code to...
Read more >Cannot read property 'querySelectorAll' of null - OutSystems
i just update my app to OutsystemsUI 2.3.0 and after the update when i open the Menu Block i got the this error...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
My bad, the script tags were supposed to be at the end of body, not in head.
I had a really dumb error that caused this error message. The div I was trying to change into a graph I had as div id=“#all_results” which obviously should have been div id=“all_results”. Moral of the story, check to make sure you have things named properly, etc because it’ll trigger this message.