Mando
Mando

Reputation: 11712

Unable to build an Ionic/Angular app after packages upgrade

I've upgraded Ionic and angular packages to the latest version and unable to run ionic build

my dependencies are:

 "@angular/core": "~10.1.4",
 "ionic-angular": "^3.9.10",

And the error I'm getting when trying to build is below:

node_modules/ionic-angular/umd/components/item/item-divider.d.ts:1:22 - error TS2724: Module '"../../../../@angular/core/core"' has no exported member 'Renderer'. Did you mean 'Renderer2'?

1 import { ElementRef, Renderer } from '@angular/core';
                       ~~~~~~~~

  node_modules/@angular/core/core.d.ts:5964:31
    5964 export declare abstract class Renderer2 {
                                       ~~~~~~~~~
    'Renderer2' is declared here.

Please advise how to make the ionic-angular dependency work.

Upvotes: 1

Views: 367

Answers (2)

Mando
Mando

Reputation: 11712

The packages @angular/core and ionic-angular are incompatible and upgrading angular to v10 forces to use @ionic/angular package instead:

https://ionicframework.com/docs/reference/migration#changes-in-package-name

Upvotes: 1

Mike Leins
Mike Leins

Reputation: 52

Try to import Renderer2 instead of Renderer.

Upvotes: 0

Related Questions