Skip to content
This repository was archived by the owner on May 1, 2020. It is now read-only.
This repository was archived by the owner on May 1, 2020. It is now read-only.

TypeError: o is not a function using NGO #1256

@mburger81

Description

@mburger81

Short description of the problem:

In our project we are using this angular datatable https://github.com/swimlane/ngx-datatable in version before 10.1.0, because this is using typescript 2.4.x which does not work with latest ionic.
So if we use version 10.0.5 or 9.3.1 with your latest app-scripts running a production build for android
ionic cordova run android --prod
we get this error on importing

import { NgxDatatableModule } from '@swimlane/ngx-datatable';
imports: [
        IonicModule,
        NgxDatatableModule,

on an module

ERROR Error: Uncaught (in promise): TypeError: o is not a function
TypeError: o is not a function
    at 4.js:1
    at Object../node_modules/rxjs/util/UnsubscriptionError.js (4.js:1)
    at t (4.js:1)
    at Object../node_modules/rxjs/Subscription.js (4.js:1)
    at t (4.js:1)
    at Object../node_modules/rxjs/Subscriber.js (4.js:1)
    at t (4.js:1)
    at Object../node_modules/rxjs/util/toSubscriber.js (4.js:1)
    at t (4.js:1)
    at Object../node_modules/rxjs/Observable.js (4.js:1)
    at t (4.js:1)
    at Object../node_modules/rxjs/add/observable/fromEvent.js (4.js:1)
    at t (4.js:1)
    at Object../src/datatable.module.ts (4.js:1)
    at t (4.js:1)
    at Object../src/index.ts (4.js:1)
    at t (4.js:1)
    at 4.js:1
    at 4.js:1
    at n (4.js:1)
    at Object.865 (4.js:1)
    at e (vendor.js:1)
    at Object.562 (4.js:1)
    at e (vendor.js:1)
    at main.js:1
    at t.invoke (polyfills.js:3)
    at Object.onInvoke (vendor.js:1)
    at t.invoke (polyfills.js:3)
    at r.run (polyfills.js:3)
    at polyfills.js:3
    at t.invokeTask (polyfills.js:3)
    at Object.onInvokeTask (vendor.js:1)
    at t.invokeTask (polyfills.js:3)
    at r.runTask (polyfills.js:3)
    at o (polyfills.js:3)
    at <anonymous>
    at 4.js:1
    at Object../node_modules/rxjs/util/UnsubscriptionError.js (4.js:1)
    at t (4.js:1)
    at Object../node_modules/rxjs/Subscription.js (4.js:1)
    at t (4.js:1)
    at Object../node_modules/rxjs/Subscriber.js (4.js:1)
    at t (4.js:1)
    at Object../node_modules/rxjs/util/toSubscriber.js (4.js:1)
    at t (4.js:1)
    at Object../node_modules/rxjs/Observable.js (4.js:1)
    at t (4.js:1)
    at Object../node_modules/rxjs/add/observable/fromEvent.js (4.js:1)
    at t (4.js:1)
    at Object../src/datatable.module.ts (4.js:1)
    at t (4.js:1)
    at Object../src/index.ts (4.js:1)
    at t (4.js:1)
    at 4.js:1
    at 4.js:1
    at n (4.js:1)
    at Object.865 (4.js:1)
    at e (vendor.js:1)
    at Object.562 (4.js:1)
    at e (vendor.js:1)
    at main.js:1
    at t.invoke (polyfills.js:3)
    at Object.onInvoke (vendor.js:1)
    at t.invoke (polyfills.js:3)
    at r.run (polyfills.js:3)
    at polyfills.js:3
    at t.invokeTask (polyfills.js:3)
    at Object.onInvokeTask (vendor.js:1)
    at t.invokeTask (polyfills.js:3)
    at r.runTask (polyfills.js:3)
    at o (polyfills.js:3)
    at <anonymous>
    at c (polyfills.js:3)
    at Object.reject (polyfills.js:3)
    at e._fireError (vendor.js:1)
    at e._failed (vendor.js:1)
    at vendor.js:1
    at t.invoke (polyfills.js:3)
    at Object.onInvoke (vendor.js:1)
    at t.invoke (polyfills.js:3)
    at r.run (polyfills.js:3)
    at polyfills.js:3
    at t.invokeTask (polyfills.js:3)
    at Object.onInvokeTask (vendor.js:1)
    at t.invokeTask (polyfills.js:3)
    at r.runTask (polyfills.js:3)
    at o (polyfills.js:3)
    at <anonymous>

If we do your workaround from changelog doing only
ionic cordova run android --aot --minifyJs --minifyCss
instead of --prod anything is fine

Which @ionic/app-scripts version are you using?

ionic info
cli packages: (/usr/lib/node_modules)
    @ionic/cli-utils  : 1.12.0
    ionic (Ionic CLI) : 3.12.0

global packages:
    cordova (Cordova CLI) : 7.0.1 

local packages:
    @ionic/app-scripts : 3.0.0
    Cordova Platforms  : android 6.2.3
    Ionic Framework    : ionic-angular 3.7.1

System:
    Android SDK Tools : 26.1.1
    Node              : v6.11.3
    npm               : 5.4.2 
    OS                : Linux 4.10

Misc:
    backend : legacy

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions