rossmartin / ionic2-alpha-scroll

:arrow_up_down: :capital_abcd: Configurable Ionic 2 component for alphabetically indexed list with an alpha scroll bar.
MIT License
66 stars 22 forks source link

ion-alpha-scroll error when 'ionic build android' #9

Closed julianlecalvez closed 7 years ago

julianlecalvez commented 8 years ago

Hello,

I'm migrating my ionic2 app from te beta.11 to the RC3. And since I did this migration, I got a compilation error when I try to build for android. When I remove the ion-alpha-scroll tag from the template, the compiler doesn't generate any errors !

Here is the error in the console :

[12:02:38] Error: Error at /MYPATH/.tmp/node_modules/ionic2-alpha-scroll/ion-alpha-scroll.ngfactory.ts:136:43 [12:02:38] Module ''*'' has no exported member 'Wrapper_DynamicComponentDirective'. [12:02:38] ngc failed [12:02:38] ionic-app-script task: "build" [12:02:38] Error: Error

And here is my ion-alpha-scroll call :

  <ion-alpha-scroll *ngIf="items" [listData]="items" key="name"
    [itemTemplate]="alphaScrollItemTemplate" [currentPageClass]="currentPageClass" [triggerChange]="triggerAlphaScrollChange">
  </ion-alpha-scroll>

What should I change to fix this pb ?

Thanks !

rossmartin commented 8 years ago

To be sure you have the latest version uninstall and reinstall the component -

npm uninstall ionic2-alpha-scroll --save
npm install ionic2-alpha-scroll --save

Next update your src/app/main.prod.ts and src/app/app.module.ts shown here

Let me know if that doesn't solve your problem.

julianlecalvez commented 7 years ago

Hello @rossmartin,

I have another issue with prod compilation (and only this one).

[11:21:17]  ngc started ... 
[11:21:19]  build prod failed: Cannot determine the module for class MapToIterable in 
            /Users/julianlecalvez/Documents/SFR/Biometo/node_modules/ionic2-alpha-scroll/ion-alpha-scroll.d.ts! 
[11:21:19]  ionic-app-script task: "build" 
[11:21:19]  Error: Cannot determine the module for class MapToIterable in 
            /Users/julianlecalvez/Documents/SFR/Biometo/node_modules/ionic2-alpha-scroll/ion-alpha-scroll.d.ts! 

I doubled check the config, reinstall the module and I think I'm ok (with the RC5 version). The plugin works in dev mode. Here is my main.ts :

import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { COMPILER_PROVIDERS } from '@angular/compiler';
import { AppModule } from './app.module';
platformBrowserDynamic([COMPILER_PROVIDERS]).bootstrapModule(AppModule);

I also tried with enableProdMode() :

import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { enableProdMode } from '@angular/core';
import { COMPILER_PROVIDERS } from '@angular/compiler';
import { AppModule } from './app.module';

enableProdMode();
platformBrowserDynamic([COMPILER_PROVIDERS]).bootstrapModule(AppModule);

I always get the same error :(

Thanks for your help !

Julian

rossmartin commented 7 years ago

I'm not sure if I will get to updating this component to support the latest release candidate versions. I plan to update it for the final release of Ionic 2 though. There have been too many breaking changes between rc versions and it has really been frustrating to say the least.

julianlecalvez commented 7 years ago

Thanks for your answer ! I think they listened to you cuz they released the final version 2.0.0 one hour after this post ^^

rossmartin commented 7 years ago

lol.

I was able to fix this issue but I can't figure out how to get the component to work with AoT compiling. This issue is fixed in 1.0.9 but now I need to solve the AoT compiling issue.

I'm going to leave this open for now until you are able to try the latest version. Thanks.

julianlecalvez commented 7 years ago

ok I tried to install your module locally to help you fixing the AoT bug, but I have dependencies problem at installation time with angular-core :/ it's not just npm install /Users/...../ionic2-alpha-scroll --save ?

julianlecalvez commented 7 years ago

ok forget my message. I'm stupid... i try to find a way to fix the bug ;)

rossmartin commented 7 years ago

OK, can you confirm that this issue is fixed for you? If so I'll close this one and open a new issue for the AoT compiling and we can continue there.

julianlecalvez commented 7 years ago

Yes it is. I only have the AoT compilation now