Ionic-framework: Object(...) is not a function after ionic cli upgrade

Created on 5 Apr 2018  路  3Comments  路  Source: ionic-team/ionic-framework

Ionic version: (check one with "x")
(For Ionic 1.x issues, please use https://github.com/ionic-team/ionic-v1)
[ ] 2.x
[x] 3.x
[ ] 4.x

I'm submitting a ... (check one with "x")
[x] bug report
[ ] feature request

Current behavior:

  1. updated ionic cli to 3.20.0 from 3.19.1
  2. import {TranslateService} from '@ngx-translate/core'; ngx-translate/core package went missing, npm install fixed this package issue
  3. ionic serve worked
  4. got a run time error:

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

After upgrade, there shouldn't be a runtime error;

Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):

Runtime Error
Object(...) is not a function
Stack
TypeError: Object(...) is not a function
    at TranslateService.get (http://localhost:8100/build/vendor.js:67817:72)
    at TranslatePipe.updateValue (http://localhost:8100/build/vendor.js:68090:24)
    at TranslatePipe.transform (http://localhost:8100/build/vendor.js:68123:14)
    at Object.eval [as updateDirectives] (ng:///AppModule/TabsPage.ngfactory.js:73:13)
    at Object.debugUpdateDirectives [as updateDirectives] (http://localhost:8100/build/vendor.js:14692:21)
    at checkAndUpdateView (http://localhost:8100/build/vendor.js:13861:14)
    at callViewAction (http://localhost:8100/build/vendor.js:14211:21)
    at execComponentViewsAction (http://localhost:8100/build/vendor.js:14143:13)
    at checkAndUpdateView (http://localhost:8100/build/vendor.js:13867:5)
    at callViewAction (http://localhost:8100/build/vendor.js:14211:21)
Ionic Framework: 3.9.0
Ionic Native: ^2.9.0
Ionic App Scripts: 3.1.8
Angular Core: 5.0.0
Angular Compiler CLI: 5.0.0
Node: 9.4.0
OS Platform: macOS High Sierra
Navigator Platform: MacIntel
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36
cli packages: (/Users/[username]/apps/[projectname]/node_modules)

    @ionic/cli-utils  : 1.19.2
    ionic (Ionic CLI) : 3.20.0

global packages:

    cordova (Cordova CLI) : 8.0.0

local packages:

    @ionic/app-scripts : 3.1.8
    Cordova Platforms  : ios 4.5.4
    Ionic Framework    : ionic-angular 3.9.0

System:

    ios-deploy : 1.9.2
    Node       : v9.4.0
    npm        : 5.6.0
    OS         : macOS High Sierra
    Xcode      : Xcode 9.3 Build version 9E145

Environment Variables:

    ANDROID_HOME : not set

Misc:

    backend : pro
triage

Most helpful comment

What version of the the ngx-translate/core are you using?
Version 10 and up have breaking changes. (https://github.com/ngx-translate/core/releases)
And since Ionic is not yet supporting angular 6 you need to stay at version 9.1.1 for the core and 2.0.1 for the HTTP-loader and if you use the rxjs library as well keep that on 5.5.0

All 3 comments

What version of the the ngx-translate/core are you using?
Version 10 and up have breaking changes. (https://github.com/ngx-translate/core/releases)
And since Ionic is not yet supporting angular 6 you need to stay at version 9.1.1 for the core and 2.0.1 for the HTTP-loader and if you use the rxjs library as well keep that on 5.5.0

I imported angular translate into each submodules and it works now.

Thanks for helping!

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

GeorgeAnanthSoosai picture GeorgeAnanthSoosai  路  3Comments

Nick-The-Uncharted picture Nick-The-Uncharted  路  3Comments

alexbainbridge picture alexbainbridge  路  3Comments

fdnhkj picture fdnhkj  路  3Comments

danbucholtz picture danbucholtz  路  3Comments