question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug: Angular 12 not compatible with Ionic 6.1.9

See original GitHub issue

Prerequisites

Ionic Framework Version

  • v4.x
  • v5.x
  • v6.x
  • Nightly

Current Behavior

While upgrading a fully functional project using router and ionic 5 from angular 11 and ionic 5 to angular 12 and ionic 6, following error occurs.

Please note keeping ionic 5 along with angular 12 doesn’t produce problem. But we need some ionic 6 features for our project.

ERROR Error: Uncaught (in promise): TypeError: componentFactory.create is not a function
TypeError: componentFactory.create is not a function
    at ViewContainerRef.createComponent (core.js:23191:1)
    at IonRouterOutlet.activateWith (ionic-angular.js:3437:57)
    at ActivateRoutes.activateRoutes (router.js:2163:1)
    at router.js:2114:1
    at Array.forEach (<anonymous>)
    at ActivateRoutes.activateChildRoutes (router.js:2113:1)
    at ActivateRoutes.activate (router.js:2034:1)
    at MapSubscriber.project (router.js:2019:1)
    at MapSubscriber._next (map.js:29:1)
    at MapSubscriber.next (Subscriber.js:49:1)
    at resolvePromise (zone.js:1262:1)
    at resolvePromise (zone.js:1216:1)
    at zone.js:1329:1
    at push.6026._ZoneDelegate.invokeTask (zone.js:443:1)
    at Object.onInvokeTask (core.js:28679:1)
    at push.6026._ZoneDelegate.invokeTask (zone.js:442:1)
    at push.6026.Zone.runTask (zone.js:214:1)
    at drainMicroTaskQueue (zone.js:632:1)

Expected Behavior

No error while upgrading to angular 12 on a project using routing and ionic 6 since packages are indicated to be compatible.

Steps to Reproduce

ionic start ionic6 tabs --cordova --no-deps

Delete Tabs module and point to Explore container component as the only route, adding component in app.module.

Change angular 14 for angular 12 which is stated to be compatible with on ionic page.

Error occurs.

Code Reproduction URL

https://github.com/blackholegalaxy/repro-ionic-bug

Ionic Info

$ ionic info

Ionic:

Ionic CLI : 6.19.1 (C:\Users\X\AppData\Roaming\npm\node_modules@ionic\cli) Ionic Framework : @ionic/angular 6.1.9 @angular-devkit/build-angular : 12.2.17 @angular-devkit/schematics : 13.3.7 @angular/cli : 12.2.17 @ionic/angular-toolkit : 6.1.0

Cordova:

Cordova CLI : 11.0.0 Cordova Platforms : not available Cordova Plugins : not available

Utility:

cordova-res : not installed globally native-run : not installed globally

System:

NodeJS : v16.13.2 (C:\Program Files\nodejs\node.exe) npm : 8.1.2 OS : Windows 10

Additional Information

The error points to ionic-angular file which tries to land in angular 14 else block.

image

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
sean-perkinscommented, Jun 10, 2022

Can either of you test with this dev-build and let me know if the problem is resolved?

6.1.10-dev.11654882801.1eb62ed9

I’ve validated it works with:

  • Angular 14 projects
  • The reproduction provided (Angular 12)

Appreciate the extra testing/second set of eyes.

Thanks!

0reactions
ionitron-bot[bot]commented, Jul 13, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Upgrading to Ionic 6 | Ionic Documentation
Follow this guide to upgrade your Ionic 5 apps to Ionic 6. Getting Started​. Angular​. Ionic 6 supports Angular 12+. Update to the...
Read more >
Angular CLI version is not compatible with Angular version
The Problem. The CLI version you have installed doesn't meet the requirements for your Angular version as the error says:
Read more >
Resolved: This version of CLI is compatible with Angular version
This error is most visible when you are trying to migrate an older Angular framework (Example- Angular 5 or 6 or 7 or...
Read more >
@ionic/angular - npm
Start using @ionic/angular in your project by running `npm i ... we need the schematics-cli (once published, this will not be needed).
Read more >
Changelog - Ionic 5 Full Starter App
Update @angular/fire implementation to match new Firebase 9 API ... It was not compatible with the latest version of Firebase v9 and when ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found