melwinVincent / ionic4-star-rating

Star Rating component for ionic-4 projects
23 stars 11 forks source link

Compilation error #1

Closed nivaldomartinez closed 5 years ago

nivaldomartinez commented 5 years ago

I'm trying to compile my project but i have an error related to ionic4-star-rating.

when run the following command:

ionic cordova build ios --prod

I get the following error:

ERROR in : Type StarRating in node_modules/ionic4-star-rating/dist/components/ionic4-star-rating-component.d.ts is part of the declarations of 2 modules: ComponentsModule in src/app/components/components.module.ts and StarRatingModule in node_modules/ionic4-star-rating/dist/ionic4-star-rating.module.d.ts!

[ERROR] An error occurred while running subprocess ng.

this is my ComponentsModule class:

@NgModule({ declarations: [ GoogleMapsComponent, TripViewComponent, StarRating, ProgressBarComponent ], exports: [ GoogleMapsComponent, TripViewComponent, ProgressBarComponent, StarRating ], imports: [ CommonModule, IonicModule ] }) export class ComponentsModule { }

Could you help me with this please

omahjoub commented 5 years ago

Having the same issue here :

ERROR in : Type StarRating in XXX/node_modules/ionic4-star-rating/dist/components/ionic4-star-rating-component.d.ts 
is part of the declarations of 2 modules: 

SharedModule in XXX/src/app/components/shared.module.ts 
and StarRatingModule in XXX/node_modules/ionic4-star-rating/dist/ionic4-star-rating.module.d.ts! 

Please consider moving StarRating in XXX/node_modules/ionic4-star-rating/dist/components/ionic4-star-rating-component.d.ts 
to a higher module that imports SharedModule in XXX/src/app/components/shared.module.ts 
and StarRatingModule in XXX/node_modules/ionic4-star-rating/dist/ionic4-star-rating.module.d.ts.

You can also create a new NgModule that exports and includes StarRating in XXX/node_modules/ionic4-star-rating/dist/components/ionic4-star-rating-component.d.ts 
then import that NgModule in SharedModule in 
XXX/src/app/components/shared.module.ts 
and StarRatingModule in XXX/node_modules/ionic4-star-rating/dist/ionic4-star-rating.module.d.ts.

Here is the ionic inforesult :


   Ionic CLI                     : 5.2.3 (/usr/local/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.7.1
   @angular-devkit/build-angular : 0.801.2
   @angular-devkit/schematics    : 8.1.2
   @angular/cli                  : 8.1.2
   @ionic/angular-toolkit        : 2.0.0

Cordova:

   Cordova CLI       : 9.0.0 (cordova-lib@9.0.1)
   Cordova Platforms : not available
   Cordova Plugins   : not available

Utility:

   cordova-res : 0.3.0 (update available: 0.6.0)
   native-run  : 0.2.2 (update available: 0.2.8)

System:

   Android SDK Tools : 26.1.1 (/Users/oussamamahjoub/Library/Android/sdk)
   ios-deploy        : 1.9.4
   ios-sim           : 8.0.1
   NodeJS            : v12.6.0 (/usr/local/bin/node)
   npm               : 6.10.2
   OS                : macOS Mojave
   Xcode             : Xcode 10.3 Build version 10G8
MichaelGoberling commented 5 years ago

I've found this issue can be solved by importing the StarRatingModule into the page/component's module.ts that you need it in, instead of adding the StarRating component to the declaration/export of your module.

However, building with this component fails, and I've outlined that here: https://github.com/melwinVincent/ionic4-star-rating/issues/3

iamnels1 commented 5 years ago

Hi,

Same problem here... I can't build for production :

ERROR in : Type StarRating in C:/Users/888/app/my-app/node_modules/ionic4-star-rating/dist/components/ionic4-star-rating-component.d.ts is part of the declarations of 2 modules: SharedModule in C:/Users/888/app/my-app/src/app/shared/shared.module.ts and StarRatingModule in C:/Users/888/app/my-app/node_modules/ionic4-star-rating/dist/ionic4-star-rating.module.d.ts! Please consider moving StarRating in C:/Users/888/app/my-app/node_modules/ionic4-star-rating/dist/components/ionic4-star-rating-component.d.ts to a higher module that imports SharedModule in C:/Users/888/app/my-app/src/app/shared/shared.module.ts and StarRatingModule in C:/Users/888/app/my-app/node_modules/ionic4-star-rating/dist/ionic4-star-rating.module.d.ts. You can also create a new NgModule that exports and includes StarRating in C:/Users/888/app/my-app/node_modules/ionic4-star-rating/dist/components/ionic4-star-rating-component.d.ts then import that NgModule in SharedModule in C:/Users/888/app/my-app/src/app/shared/shared.module.ts and StarRatingModule in C:/Users/888/app/my-app/node_modules/ionic4-star-rating/dist/ionic4-star-rating.module.d.ts.

Ionic:

ionic (Ionic CLI) : 4.12.0 (C:\Users\888\AppData\Roaming\npm\node_modules\ionic) Ionic Framework : @ionic/angular 4.4.2 @angular-devkit/build-angular : 0.13.9 @angular-devkit/schematics : 7.3.9 @angular/cli : 7.3.9 @ionic/angular-toolkit : 1.5.1

Capacitor:

capacitor (Capacitor CLI) : 1.0.0 @capacitor/core : 1.0.0

System:

NodeJS : v10.16.0 (C:\Program Files\nodejs\node.exe) npm : 6.9.0 OS : Windows 7

sameer-sm01 commented 5 years ago

Hi also getting same error . so i have changes in index.d.ts of ionic4-start-rating commented the following line export * from './ionic4-star-rating.module';

iamnels1 commented 5 years ago

Sameer you are awesome !!!

melwinVincent commented 5 years ago

@nivaldomartinez @omahjoub @iamnels1 @MichaelGoberling @sameer-sm01

This issue has been fixed in the latest release.

Please install the latest version npm i ionic4-star-rating@1.1.1

You don't have to comment out export * from './ionic4-star-rating.module'; in the index.d.ts of ionic4-start-rating

Do not use shared.module instead just import StarRatingModule in your parent-component.module.ts as shown in step-2 in docs

Capture

zraees commented 4 years ago

@nivaldomartinez @omahjoub @iamnels1 @MichaelGoberling @sameer-sm01

This issue has been fixed in the latest release.

Please install the latest version npm i ionic4-star-rating@1.1.1

You don't have to comment out export * from './ionic4-star-rating.module'; in the index.d.ts of ionic4-start-rating

Do not use shared.module instead just import StarRatingModule in your parent-component.module.ts as shown in step-2 in docs

Capture

Dear, I am using Ionic4-star-rating in Ionic5 and getting following error:

ERROR in ./node_modules/ionic4-star-rating/dist/components/ionic4-star-rating-component.js 148:41-47 [ng] "export 'Events' was not found in '@ionic/angular'

paulolira73 commented 4 years ago

events is deprecated in ionic 5!

have same issue that every body

can you adapt ionic4 version to ionic 5 version without 'events?

https://forum.ionicframework.com/t/best-way-to-replace-deprecated-events/174695/6