Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
omelsoft opened this issue Nov 9, 2018 · 6 comments
Open

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

omelsoft opened this issue Nov 9, 2018 · 6 comments

Comments

@omelsoft
Copy link

omelsoft commented Nov 9, 2018

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 omelsoft changed the title Runtime Error: Object(...) is not a function Runtime Error: Object(...) is not a function with Ionic 4.x.x Nov 9, 2018
@omelsoft omelsoft changed the title Runtime Error: Object(...) is not a function with Ionic 4.x.x Runtime Error: Object(...) is not a function with Ionic 4.2.1 Nov 9, 2018
@omelsoft omelsoft changed the title Runtime Error: Object(...) is not a function with Ionic 4.2.1 Runtime Error: Object(...) is not a function Nov 9, 2018
@omelsoft
Copy link
Author

omelsoft commented Nov 9, 2018

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 added a commit to omelsoft/ion-affix that referenced this issue Nov 9, 2018
@betojsx
Copy link

betojsx commented Nov 10, 2018

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

@omelsoft
Copy link
Author

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

I'm glad it helped you too. :)

@jonaszuberbuehler
Copy link
Owner

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

@andrew-lyashenko
Copy link

any news about PR?

samarties added a commit to OurPeople/ion-affix that referenced this issue Aug 14, 2019
@damonsomu
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants