0

I am using the NgXCreditCardsModule for the credit card validation in my angular6 application and I was able to use it through ng serve. But when I tried to build the war file using maven I am getting below error:

ERROR in : Unexpected value 'NgXCreditCardsModule in C:/Users/infouser/git/branches/Orion-App/orion-ui/node_modules/ngx-credit-cards/index.js' imported by the module 'PaypalPaymentModule in C:/Users/infouser/git/branches/Orion-App/orion-ui/src/app/modules/paypal-payment/paypal-payment.module.ts'. Please add a @NgModule annotation.

I am attaching the code of my angular module

import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { PaymentFormComponent } from './components/payment-form/payment-form.component';
import { Routes, RouterModule } from '@angular/router';
import { HomeGuardService } from '../../shared/guards/home.guard';
import { MaterialModule } from '../material/material.module';
import { FlexLayoutModule } from '@angular/flex-layout';
import { ReactiveFormsModule } from '@angular/forms';
import { NgXCreditCardsModule } from 'ngx-credit-cards';

const routes: Routes = [{ path: '', component: PaymentFormComponent }];
@NgModule({
  imports: [CommonModule, RouterModule.forChild(routes), MaterialModule, FlexLayoutModule, ReactiveFormsModule, NgXCreditCardsModule],
  declarations: [PaymentFormComponent]
})
export class PaypalPaymentModule {}

Can someone tell me how to fix the build issue

nircraft
  • 8,242
  • 5
  • 30
  • 46
Thejas
  • 379
  • 5
  • 24
  • a war file? How are you generating that, can you show your build script? – nircraft Jul 18 '19 at 16:23
  • @nircraft I am doing mvn install. I get this error when I build the serve side code. – Thejas Jul 18 '19 at 16:34
  • Do you have ` angular-project node_installation ` and ` ${angular.project.location} ${angular.project.nodeinstallation} ` in pom.xml? – nircraft Jul 18 '19 at 16:46
  • This answer may help you: https://stackoverflow.com/a/45943326/9386929 – nircraft Jul 18 '19 at 16:47
  • Possible duplicate of [How to setup angular 4 inside a maven based java war project](https://stackoverflow.com/questions/45915379/how-to-setup-angular-4-inside-a-maven-based-java-war-project) – nircraft Jul 18 '19 at 16:50
  • @nircraft This is a working application . There are lot of modules which are functional. Its not a set up issue – Thejas Jul 18 '19 at 16:50
  • Regardless of whether the application worked previously, failure to build is a setup issue. – The Head Rush Jul 18 '19 at 16:55

0 Answers0