Ion-infinite-scroll: Cannot call complete method of


When trying to call the complete method for infinite scroll, I get the error: is possibly null

You can see the code below, and I am passing the $event to the loadData method


Does anyone know what’s going on here? Without calling infinite scroll only loads the second page and then stops working.

In case anyone else runs into this, I managed to get this working by changing the event type from CustomEvent to any which is different from the documentation Infinite Scroller | ion-infinite-scroll Action Component

I also found this feat(all): add CustomEvents types to components that let you call methods on the target by liamdebeasi · Pull Request #23956 · ionic-team/ionic-framework · GitHub and after following the instructions to update to next branch ionic-framework/ at b0eadfe229878aad4419203d8d73c01733ce8fbf · ionic-team/ionic-framework · GitHub I managed to get it working using the InfiniteScrollCustomEvent type.

The upgrade steps for beta work great, but it was also necessary to manually install webpack v5. Running vue upgrade --next didn’t fix the issue.