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.

Cannot read property 'query' of null

See original GitHub issue

I got this error after updating from 0.1.2 to 0.1.3.

EXCEPTION: TypeError: Cannot read property ‘query’ of null

The code is quite simple:

import { Component } from '@angular/core';
import { bootstrap } from '@angular/platform-browser-dynamic';
import { InfiniteScroll } from 'angular2-infinite-scroll';

@Component({
  selector: 'app',
  directives: [InfiniteScroll],
  styles: [`
    .search-results {
      height: 20rem;
      overflow: scroll;
    }
  `],
  template: `
    Hello InfiniteScroll!
    <div class="search-results"
         infinite-scroll
         [infiniteScrollDistance]="2"
         [infiniteScrollThrottle]="500"
         (scrolled)="onScroll()">
      <p>1</p>
      <p>2</p>
      <p>3</p>
    </div>
  `
})
class App {
  onScroll () {
    console.log('scrolled!!')
  }
}
bootstrap(App);

It happens after I adding this part (Without this part, no error):

<div class="search-results"
    infinite-scroll
    [infiniteScrollDistance]="2"
    [infiniteScrollThrottle]="500"
    (scrolled)="onScroll()">
  <p>1</p>
  <p>2</p>
  <p>3</p>
</div>

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
marcaljcommented, Jun 17, 2016

Fantastic, it works, thanks!

0reactions
orizenscommented, Jun 16, 2016

@tallkid24 @marcalj i have confirmed this - thanks! a fix will be pushed soon.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot read property 'query' of null? - node.js - Stack Overflow
In your error handler here: if (err) { console.log("not able to get connection " + err); res.status(400).send(err); } client.query(...).
Read more >
useRouter() error "Cannot read property 'query' of null" #11818
Within a component, I'm calling useRouter. I want to get the query param (if present) and then pass it on to Query or...
Read more >
T32154 Uncaught TypeError: Cannot read property 'query' of ...
This bug doesn't seems to happen often, but I've noticed the following error after trying to ... Uncaught TypeError: Cannot read property 'query'...
Read more >
cannot read properties of undefined (reading 'query') - You.com
The "Cannot read properties of undefined" error occurs for multiple reasons: Accessing a property on a variable that stores an undefined value. Accessing...
Read more >
Cannot read property 'query' of null?-postgresql - appsloveworld
query ('SELECT * FROM employee WHERE empid=$1', [1], function (err, result) { done(); // closing the connection; if (err) { console.log(err); res.status(400).
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