Updating to RC0, issues with IONIC_DIRECTIVES (I guess ?)


#1

Hi there,

I am trying to update my app from beta11 to RC0 but I’ve got an issue. Here is the errors I have when trying to build my app:

[11:29:16]  ngc error: Error: Error at /Users/stephane/work/ionic/tucao-app/.tmp/components/user-line-item/user-line-item.ngfactory.ts:16:26: Cannot find module '../../node_modules/ionic-angular/components/avatar/avatar.ngfactory'.
Error at /Users/stephane/work/ionic/tucao-app/.tmp/components/user-line-item/user-line-item.ngfactory.ts:17:27: Cannot find module '../../node_modules/ionic-angular/components/backdrop/backdrop.ngfactory'.
Error at /Users/stephane/work/ionic/tucao-app/.tmp/components/user-line-item/user-line-item.ngfactory.ts:18:27: Cannot find module '../../node_modules/ionic-angular/components/badge/badge.ngfactory'.
Error at /Users/stephane/work/ionic/tucao-app/.tmp/components/user-line-item/user-line-item.ngfactory.ts:20:27: Cannot find module '../../node_modules/ionic-angular/components/card/card.ngfactory'.
Error at /Users/stephane/work/ionic/tucao-app/.tmp/components/user-line-item/user-line-item.ngfactory.ts:22:27: Cannot find module '../../node_modules/ionic-angular/components/chip/chip.ngfactory'.
Error at /Users/stephane/work/ionic/tucao-app/.tmp/components/user-line-item/user-line-item.ngfactory.ts:23:27: Cannot find module '../../node_modules/ionic-angular/components/grid/grid.ngfactory'.
Error at /Users/stephane/work/ionic/tucao-app/.tmp/components/user-line-item/user-line-item.ngfactory.ts:28:27: Cannot find module '../../node_modules/ionic-angular/components/show-hide-when/show-hide-when.ngfactory'.
Error at /Users/stephane/work/ionic/tucao-app/.tmp/components/user-line-item/user-line-item.ngfactory.ts:29:27: Cannot find module '../../node_modules/ionic-angular/components/icon/icon.ngfactory'.
Error at /Users/stephane/work/ionic/tucao-app/.tmp/components/user-line-item/user-line-item.ngfactory.ts:31:27: Cannot find module '../../node_modules/ionic-angular/components/infinite-scroll/infinite-scroll.ngfactory'.
Error at /Users/stephane/work/ionic/tucao-app/.tmp/components/user-line-item/user-line-item.ngfactory.ts:37:27: Cannot find module '../../node_modules/ionic-angular/components/label/label.ngfactory'.
Error at /Users/stephane/work/ionic/tucao-app/.tmp/components/user-line-item/user-line-item.ngfactory.ts:38:27: Cannot find module '../../node_modules/ionic-angular/components/list/list.ngfactory'.
Error at /Users/stephane/work/ionic/tucao-app/.tmp/components/user-line-item/user-line-item.ngfactory.ts:39:27: Cannot find module '../../node_modules/ionic-angular/components/list/list-header.ngfactory'.
Error at /Users/stephane/work/ionic/tucao-app/.tmp/components/user-line-item/user-line-item.ngfactory.ts:41:27: Cannot find module '../../node_modules/ionic-angular/components/menu/menu-close.ngfactory'.
Error at /Users/stephane/work/ionic/tucao-app/.tmp/components/user-line-item/user-line-item.ngfactory.ts:42:27: Cannot find module '../../node_modules/ionic-angular/components/menu/menu-toggle.ngfactory'.
Error at /Users/stephane/work/ionic/tucao-app/.tmp/components/user-line-item/user-line-item.ngfactory.ts:43:27: Cannot find module '../../node_modules/ionic-angular/components/input/native-input.ngfactory'.
Error at /Users/stephane/work/ionic/tucao-app/.tmp/components/user-line-item/user-line-item.ngfactory.ts:46:27: Cannot find module '../../node_modules/ionic-angular/components/nav/nav-pop.ngfactory'.
Error at /Users/stephane/work/ionic/tucao-app/.tmp/components/user-line-item/user-line-item.ngfactory.ts:47:27: Cannot find module '../../node_modules/ionic-angular/components/nav/nav-push.ngfactory'.
Error at /Users/stephane/work/ionic/tucao-app/.tmp/components/user-line-item/user-line-item.ngfactory.ts:48:27: Cannot find module '../../node_modules/ionic-angular/components/note/note.ngfactory'.
Error at /Users/stephane/work/ionic/tucao-app/.tmp/components/user-line-item/user-line-item.ngfactory.ts:49:27: Cannot find module '../../node_modules/ionic-angular/components/option/option.ngfactory'.
Error at /Users/stephane/work/ionic/tucao-app/.tmp/components/user-line-item/user-line-item.ngfactory.ts:50:27: Cannot find module '../../node_modules/ionic-angular/components/nav/overlay-portal.ngfactory'.
Error at /Users/stephane/work/ionic/tucao-app/.tmp/components/user-line-item/user-line-item.ngfactory.ts:53:27: Cannot find module '../../node_modules/ionic-angular/components/radio/radio-group.ngfactory'.

My ‘user-line-item’ is a custom component using some ionic directives (ion-avatar) inside.

Here is the code of my custom component, pretty simple:

import {Component} from '@angular/core';
import {NgClass} from '@angular/common';
import {IONIC_DIRECTIVES} from 'ionic-angular';

@Component({
    selector: 'user-line-item',
    templateUrl: 'user-line-item.html',
    inputs: ['user'],
    directives: [IONIC_DIRECTIVES, NgClass],
})

export class UserLineItem {
    avatarLoaded: boolean = false;

    userAvatarLoaded() {
        this.avatarLoaded = true;
    }
}

So I was before using “IONIC_DIRECTIVES” in my component declaration, but from the errors I am getting, it looks like it is not able to load any of the ionic directive, and I guess this is not working anymore the same way as before. How are we suppose to import Ionic directives if we want to use them in our custom components ? Should we put them in the app.module.ts file in the @NgModule declaration ? If yes, how and what are we supposed to import ?

Any help would be appreciated, I cannot find what is the problem…


#2

What happens if you just eliminate IONIC_DIRECTIVES?


#3

Looks like I got the same error messages… What could it be ? Hard to understand the meaning of those messages

EDIT: Ok, I looked back at my code and removed all the entryComponents I had in each of my @components, and I do not have this error anymore. Seems like it is not required anymore to import IONIC_DIRECTIVE anywhere… Thanks for the suggestion