ion-affix icon indicating copy to clipboard operation
ion-affix copied to clipboard

Runtime Error: Object(...) is not a function

Open omelsoft opened this issue 6 years ago • 6 comments

I found this directive helpful in one of my project by looking at each demo. However, when I tried to integrate this to my project I got an error which says Object(...) is not a function as you can see below.

TypeError: Object(...) is not a function
    at ContentAdapter.onScroll (http://localhost:8100/build/vendor.js:163017:65)
    at IonAffix.ngAfterViewInit (http://localhost:8100/build/vendor.js:112992:52)
    at callProviderLifecycles (http://localhost:8100/build/vendor.js:13433:18)
    at callElementProvidersLifecycles (http://localhost:8100/build/vendor.js:13400:13)
    at callLifecycleHooksChildrenFirst (http://localhost:8100/build/vendor.js:13383:29)
    at checkAndUpdateView (http://localhost:8100/build/vendor.js:14538:5)
    at callViewAction (http://localhost:8100/build/vendor.js:14880:21)
    at execEmbeddedViewsAction (http://localhost:8100/build/vendor.js:14838:17)
    at checkAndUpdateView (http://localhost:8100/build/vendor.js:14530:5)
    at callViewAction (http://localhost:8100/build/vendor.js:14880:21)

The following are my Ionic info:

Ionic:

   ionic (Ionic CLI)  : 4.2.1 (C:\Users\omelsoft\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework    : ionic-angular 3.9.2-201807062122
   @ionic/app-scripts : 3.2.0

Cordova:

   cordova (Cordova CLI) : 8.1.2 ([email protected])
   Cordova Platforms     : android 7.1.1
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.2.0, (and 5 other plugins)

System:

   Android SDK Tools : 26.1.1 (C:\Users\omelsoft\AppData\Local\Android\sdk)
   NodeJS            : v8.11.4 (C:\Program Files\nodejs\node.exe)
   npm               : 6.4.1
   OS                : Windows 10

omelsoft avatar Nov 09 '18 17:11 omelsoft

Managed to fix this by updating the onScroll() method to return just the ionScroll.

onScroll(): Observable { return this.content.ionScroll; // return merge(this.content.ionScrollStart, this.content.ionScroll, this.content.ionScrollEnd); }

Though you might want to take a look if this has other compatibility issues.

omelsoft avatar Nov 09 '18 18:11 omelsoft

Came here to post this issue but your solution worked for me. Many thanks!

betojsx avatar Nov 10 '18 18:11 betojsx

Came here to post this issue but your solution worked for me. Many thanks!

I'm glad it helped you too. :)

omelsoft avatar Nov 12 '18 03:11 omelsoft

@omelsoft Thanks, will have a look at the PR ASAP.

jonaszuberbuehler avatar Nov 12 '18 14:11 jonaszuberbuehler

any news about PR?

andrew-lyashenko avatar Feb 27 '19 22:02 andrew-lyashenko

Still having the issue. tried the onScroll() method but no help.

damonsomu avatar Sep 28 '21 09:09 damonsomu