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.

TypeError: Object(...) is not a function\n at attachScrollEvent

See original GitHub issue

hey there i recently try to update to the new version ngx-infinite-scroll(latest) from angular2-infinite-scroll(latest). And i have this now :

<div     infinite-scroll 
            [infiniteScrollDistance]="2"
            [infiniteScrollThrottle]="500"
            (scrolled)="onScroll()"
            [infiniteScrollDisabled]="!isMaximize"
            [scrollWindow]="false"
            [fromRoot]="true" 
            [infiniteScrollContainer]="flag1 ? '.class-wrapper': flag2 ? '.class-wrapper2' : '.class-wrapper3'">

Everything was working fine at my local environment , also on test server but when we went to staging and asked some colleagues to test it they catch a bug. The infinity scroll got stuck and doesn’t want to work more . i checked our logs and found that error : "stacktrace" : "TypeError: Object(...) is not a function\n at attachScrollEvent (0.chunk.js?v=e120c39f29142ed3cef8:176:170011)\n at createScroller (0.chunk.js?v=e120c39f29142ed3cef8:176:169370)\n at 0.chunk.js?v=e120c39f29142ed3cef8:176:172612\n at e.invoke (zone.js/0.8.20/zone.min.js:1:22107)\n at r.run (zone.js/0.8.20/zone.min.js:1:17265)\n at NgZone.runOutsideAngular (prefetch.js?v=4.0.v20180607070147:170:19140)\n at InfiniteScrollDirective.setup (0.chunk.js?v=e120c39f29142ed3cef8:176:172565)\n at InfiniteScrollDirective.ngOnChanges (0.chunk.js?v=e120c39f29142ed3cef8:176:172463)\n at checkAndUpdateDirectiveInline (prefetch.js?v=4.0.v20180607070147:78:4896)\n at checkAndUpdateNodeInline (prefetch.js?v=4.0.v20180607070147:113:6330)"

any way because i couldn’t replicate it myself i checked if there is any difference on the builds but i couldn’t find . Also i can’t provide you with example when i cannot replicate it myself … (but i see the error in the logs from my colleagues ). here are the dependencies we use :

"devDependencies": {
    "angular2-router-loader": "^0.3.5",
    "angular2-template-loader": "^0.6.2",
    "css-loader": "^0.28.7",
    "extract-text-webpack-plugin": "^3.0.2",
    "file-loader": "^1.1.5",
    "html-loader": "^0.5.1",
    "html-webpack-plugin": "^2.30.1",
    "nodemon": "1.12.1",
    "null-loader": "^0.1.1",
    "phantomjs-prebuilt": "^2.1.16",
    "raw-loader": "^0.5.1",
    "rimraf": "2.6.2",
    "style-loader": "^0.18.2",
    "ts-loader": "^3.1.1",
    "typescript": "2.6.1",
    "typings": "^2.1.1",
    "webpack": "3.8.1",
    "webpack-merge": "^4.1.1",
    "@angular/compiler": "5.1.1",
    "@angular/compiler-cli": "5.1.1",
    "@ngtools/webpack": "1.9.5"
  },
  "dependencies": {
    "@angular/animations": "5.1.1",
    "@angular/common": "5.1.1",
    "@angular/core": "5.1.1",
    "@angular/forms": "5.1.1",
    "@angular/http": "5.1.1",
    "@angular/platform-browser": "5.1.1",
    "@angular/platform-browser-dynamic": "5.1.1",
    "@angular/router": "5.1.1",
    "ngx-infinite-scroll": "^0.8.4",
    "core-js": "2.5.1",
    "es6-promise": "4.1.1",
    "es6-shim": "0.35.3",
    "intl": "1.2.5",
    "mydatepicker": "2.5.0",
    "process": "0.11.10",
    "reflect-metadata": "0.1.10",
    "rxjs": "5.5.2",
    "setimmediate": "1.0.5",
    "zone.js": "0.8.20"
  },

The steps of reproduction are just to click on button which change the isMaximize variable and then start scrolling. onScroll is just doing request to the server and updating the results 😃

Same thing without [fromRoot]="true" on other version of infiniteScroll(angular2-infinite-scroll) works fine and no one can catch that error 😃

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
guigzzcommented, Jun 12, 2018

Ok, my bad, the README explicitly says : For Angular 4 < v =< 5.5 - use version ngx-infinite-scroll@0.8.4.

With this information in mind, it works like a charm 😉

0reactions
Tsokocommented, Jun 12, 2018

@orizens thanks i will try 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

ERROR TypeError: Object(...) is not a function
I get this error in the prod mode, but not in development mode. ERROR TypeError: Object(...) is not a function ... my package.json:...
Read more >
TypeError: Object(...) is not a function : r/reactjs
TypeError : Object(...) is not a function. Hello,. While working in React I made an ES6 arrow function. When I saved my work...
Read more >
Object(...) is not a function on Angular 7
I do not know which version we are using, I updated the dependency to be sure to use the latest one. Expected behavior....
Read more >
Incident Response
Not all malicious and suspicious indicators are displayed. Get your own cloud service or the ... Spawns new processes that are not known...
Read more >
TypeError: Object(...) is not a function at Module ...
Hi ,I'm using Kendo with angular 7.2.0 but getting this error - TypeError: Object(...) is not a function at Module ...
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