Ngx-infinite-scroll: Experiencing the same issue of "TypeError:Object(...) is not a function"

Created on 31 May 2018  路  4Comments  路  Source: orizens/ngx-infinite-scroll

Expected Behavior

Got the infinite scroll working. I should see the console.log message in the console when doing this:
onScrollDown() {
console.log('down');
}

Actual Behavior

There's no message printing in the console. The onScrollDown doesn't work anymore. The error message in the console is as following:
image
The html file used is as follwing:
image

Possible Solution

  1. This problem might be related to version conflict. I used the dependency before and it works perfectly. The difference is that the ng version has been changed from 0.0.0 to 1.1.5. After updating the ng version, it doesn't work.
    I compared the package.json files and those are the things that is different:
    image
    image

  2. The version of the dependency I used has also changed from 0.8.4 to 6.0.0.

Context

Trying to make the infinite scroll work with the data-grid component. It works until the ng version is updated.

Your Environment

  • [ ] Version used: as above
  • [ ] Browser Name and version: latest chrome: Version 66.0.3359.181 (Official Build) (64-bit)
  • [ ] (Optional) Operating System and version (desktop or mobile): Windows desktop

Most helpful comment

@bailanyuan I experienced the same before I realized that per my Angular and rxjs versions, I was trying to use to new a version of ngx-infinite-scroll for my angular version.

I was at Angular ^5.0.0 and rxjs ^5.5.2. It clearly says on the main page "For Angular 4 < v =< 5.5 - use version [email protected]", so with great shame and guilt for having missed that, I installed that and viola.

I resolved it after remembering that rxjs imports can cause weird errors when there are a mix of importing the same augmentations/imports from different locations - ie rxjs vs rxjs/observable, etc. Of course differing versions would likely be an issue also - so this package using rxjs 6 might not play so nicely with older versions of rxjs in apps.

All 4 comments

+1

@bailanyuan I experienced the same before I realized that per my Angular and rxjs versions, I was trying to use to new a version of ngx-infinite-scroll for my angular version.

I was at Angular ^5.0.0 and rxjs ^5.5.2. It clearly says on the main page "For Angular 4 < v =< 5.5 - use version [email protected]", so with great shame and guilt for having missed that, I installed that and viola.

I resolved it after remembering that rxjs imports can cause weird errors when there are a mix of importing the same augmentations/imports from different locations - ie rxjs vs rxjs/observable, etc. Of course differing versions would likely be an issue also - so this package using rxjs 6 might not play so nicely with older versions of rxjs in apps.

@agscheidle You're right! I forgot to check the rxjs version. I changed the version to 0.8.4 and it works. Thanks for your help! Appreciate it!

That's great! You're welcome. Thanks for letting me know.

Was this page helpful?
0 / 5 - 0 ratings