Why Angular 6 app throwing error while deploying for production?












0















I have integrated ngx-Pagination & it working fine when I test it locally but when I run the command as ng build --prod it shows me error ERROR in ./src/app/myads/myads.component.ngfactory.js
error



If anybody knows the solution please answer.



app.module.ts



import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { FormsModule } from "@angular/forms";

import { AppComponent } from './app.component';
import { NgxPaginationModule } from "ngx-Pagination";


@NgModule({
declarations: [
AppComponent,

],
imports: [
BrowserModule,
FormsModule,
NgxPaginationModule

],
providers: ,
bootstrap: [AppComponent]
})
export class AppModule {

}


app.component.ts



import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
collection = ['r', 'k', 'u', 'jj'];
constructor() {

}


}


app.component.html



<ul>
<li *ngFor="let item of collection | paginate: { itemsPerPage: 2, currentPage: p }">Hello</li>
</ul>
<pagination-controls (pageChange)="p = $event"></pagination-controls>









share|improve this question

























  • You need to share some code. It is hard to say anything with this little information.

    – Bunyamin Coskuner
    Nov 22 '18 at 15:19











  • So, your referring to the collection in the app component, but declaring and populating the collection in the app module class? Is that working for you?

    – R. Richards
    Nov 22 '18 at 15:52











  • please check now

    – Abhayjeet Singh
    Nov 22 '18 at 15:52











  • I believe the error arrised because Angular cannot determine the module for class HomeComponent, which could be fixed by adding said component to an NgModule. Just a wild guess.

    – ritaj
    Nov 22 '18 at 16:00











  • means.........?

    – Abhayjeet Singh
    Nov 22 '18 at 16:01
















0















I have integrated ngx-Pagination & it working fine when I test it locally but when I run the command as ng build --prod it shows me error ERROR in ./src/app/myads/myads.component.ngfactory.js
error



If anybody knows the solution please answer.



app.module.ts



import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { FormsModule } from "@angular/forms";

import { AppComponent } from './app.component';
import { NgxPaginationModule } from "ngx-Pagination";


@NgModule({
declarations: [
AppComponent,

],
imports: [
BrowserModule,
FormsModule,
NgxPaginationModule

],
providers: ,
bootstrap: [AppComponent]
})
export class AppModule {

}


app.component.ts



import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
collection = ['r', 'k', 'u', 'jj'];
constructor() {

}


}


app.component.html



<ul>
<li *ngFor="let item of collection | paginate: { itemsPerPage: 2, currentPage: p }">Hello</li>
</ul>
<pagination-controls (pageChange)="p = $event"></pagination-controls>









share|improve this question

























  • You need to share some code. It is hard to say anything with this little information.

    – Bunyamin Coskuner
    Nov 22 '18 at 15:19











  • So, your referring to the collection in the app component, but declaring and populating the collection in the app module class? Is that working for you?

    – R. Richards
    Nov 22 '18 at 15:52











  • please check now

    – Abhayjeet Singh
    Nov 22 '18 at 15:52











  • I believe the error arrised because Angular cannot determine the module for class HomeComponent, which could be fixed by adding said component to an NgModule. Just a wild guess.

    – ritaj
    Nov 22 '18 at 16:00











  • means.........?

    – Abhayjeet Singh
    Nov 22 '18 at 16:01














0












0








0








I have integrated ngx-Pagination & it working fine when I test it locally but when I run the command as ng build --prod it shows me error ERROR in ./src/app/myads/myads.component.ngfactory.js
error



If anybody knows the solution please answer.



app.module.ts



import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { FormsModule } from "@angular/forms";

import { AppComponent } from './app.component';
import { NgxPaginationModule } from "ngx-Pagination";


@NgModule({
declarations: [
AppComponent,

],
imports: [
BrowserModule,
FormsModule,
NgxPaginationModule

],
providers: ,
bootstrap: [AppComponent]
})
export class AppModule {

}


app.component.ts



import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
collection = ['r', 'k', 'u', 'jj'];
constructor() {

}


}


app.component.html



<ul>
<li *ngFor="let item of collection | paginate: { itemsPerPage: 2, currentPage: p }">Hello</li>
</ul>
<pagination-controls (pageChange)="p = $event"></pagination-controls>









share|improve this question
















I have integrated ngx-Pagination & it working fine when I test it locally but when I run the command as ng build --prod it shows me error ERROR in ./src/app/myads/myads.component.ngfactory.js
error



If anybody knows the solution please answer.



app.module.ts



import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { FormsModule } from "@angular/forms";

import { AppComponent } from './app.component';
import { NgxPaginationModule } from "ngx-Pagination";


@NgModule({
declarations: [
AppComponent,

],
imports: [
BrowserModule,
FormsModule,
NgxPaginationModule

],
providers: ,
bootstrap: [AppComponent]
})
export class AppModule {

}


app.component.ts



import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
collection = ['r', 'k', 'u', 'jj'];
constructor() {

}


}


app.component.html



<ul>
<li *ngFor="let item of collection | paginate: { itemsPerPage: 2, currentPage: p }">Hello</li>
</ul>
<pagination-controls (pageChange)="p = $event"></pagination-controls>






angular angular5 angular6






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 22 '18 at 16:17







Abhayjeet Singh

















asked Nov 22 '18 at 15:17









Abhayjeet SinghAbhayjeet Singh

297




297













  • You need to share some code. It is hard to say anything with this little information.

    – Bunyamin Coskuner
    Nov 22 '18 at 15:19











  • So, your referring to the collection in the app component, but declaring and populating the collection in the app module class? Is that working for you?

    – R. Richards
    Nov 22 '18 at 15:52











  • please check now

    – Abhayjeet Singh
    Nov 22 '18 at 15:52











  • I believe the error arrised because Angular cannot determine the module for class HomeComponent, which could be fixed by adding said component to an NgModule. Just a wild guess.

    – ritaj
    Nov 22 '18 at 16:00











  • means.........?

    – Abhayjeet Singh
    Nov 22 '18 at 16:01



















  • You need to share some code. It is hard to say anything with this little information.

    – Bunyamin Coskuner
    Nov 22 '18 at 15:19











  • So, your referring to the collection in the app component, but declaring and populating the collection in the app module class? Is that working for you?

    – R. Richards
    Nov 22 '18 at 15:52











  • please check now

    – Abhayjeet Singh
    Nov 22 '18 at 15:52











  • I believe the error arrised because Angular cannot determine the module for class HomeComponent, which could be fixed by adding said component to an NgModule. Just a wild guess.

    – ritaj
    Nov 22 '18 at 16:00











  • means.........?

    – Abhayjeet Singh
    Nov 22 '18 at 16:01

















You need to share some code. It is hard to say anything with this little information.

– Bunyamin Coskuner
Nov 22 '18 at 15:19





You need to share some code. It is hard to say anything with this little information.

– Bunyamin Coskuner
Nov 22 '18 at 15:19













So, your referring to the collection in the app component, but declaring and populating the collection in the app module class? Is that working for you?

– R. Richards
Nov 22 '18 at 15:52





So, your referring to the collection in the app component, but declaring and populating the collection in the app module class? Is that working for you?

– R. Richards
Nov 22 '18 at 15:52













please check now

– Abhayjeet Singh
Nov 22 '18 at 15:52





please check now

– Abhayjeet Singh
Nov 22 '18 at 15:52













I believe the error arrised because Angular cannot determine the module for class HomeComponent, which could be fixed by adding said component to an NgModule. Just a wild guess.

– ritaj
Nov 22 '18 at 16:00





I believe the error arrised because Angular cannot determine the module for class HomeComponent, which could be fixed by adding said component to an NgModule. Just a wild guess.

– ritaj
Nov 22 '18 at 16:00













means.........?

– Abhayjeet Singh
Nov 22 '18 at 16:01





means.........?

– Abhayjeet Singh
Nov 22 '18 at 16:01












1 Answer
1






active

oldest

votes


















1














I guess you have a HomeComponent that is not declared in any module?



Try to add HomeComponent in your AppModule declarations



@NgModule({
declarations: [
AppComponent,
HomeComponent
],
imports: [
BrowserModule,
FormsModule,
NgxPaginationModule

],
providers: ,
bootstrap: [AppComponent]
})
export class AppModule {

}





share|improve this answer
























  • the actual error is this

    – Abhayjeet Singh
    Nov 22 '18 at 16:24











  • ERROR in ./src/app/app.component.ngfactory.js Module not found: Error: Can't resolve '../../node_modules/ngx-Pagination/dist/ngx-pagination.ngfactory' in 'D:paginationdemosrcapp'

    – Abhayjeet Singh
    Nov 22 '18 at 16:24











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53433950%2fwhy-angular-6-app-throwing-error-while-deploying-for-production%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














I guess you have a HomeComponent that is not declared in any module?



Try to add HomeComponent in your AppModule declarations



@NgModule({
declarations: [
AppComponent,
HomeComponent
],
imports: [
BrowserModule,
FormsModule,
NgxPaginationModule

],
providers: ,
bootstrap: [AppComponent]
})
export class AppModule {

}





share|improve this answer
























  • the actual error is this

    – Abhayjeet Singh
    Nov 22 '18 at 16:24











  • ERROR in ./src/app/app.component.ngfactory.js Module not found: Error: Can't resolve '../../node_modules/ngx-Pagination/dist/ngx-pagination.ngfactory' in 'D:paginationdemosrcapp'

    – Abhayjeet Singh
    Nov 22 '18 at 16:24
















1














I guess you have a HomeComponent that is not declared in any module?



Try to add HomeComponent in your AppModule declarations



@NgModule({
declarations: [
AppComponent,
HomeComponent
],
imports: [
BrowserModule,
FormsModule,
NgxPaginationModule

],
providers: ,
bootstrap: [AppComponent]
})
export class AppModule {

}





share|improve this answer
























  • the actual error is this

    – Abhayjeet Singh
    Nov 22 '18 at 16:24











  • ERROR in ./src/app/app.component.ngfactory.js Module not found: Error: Can't resolve '../../node_modules/ngx-Pagination/dist/ngx-pagination.ngfactory' in 'D:paginationdemosrcapp'

    – Abhayjeet Singh
    Nov 22 '18 at 16:24














1












1








1







I guess you have a HomeComponent that is not declared in any module?



Try to add HomeComponent in your AppModule declarations



@NgModule({
declarations: [
AppComponent,
HomeComponent
],
imports: [
BrowserModule,
FormsModule,
NgxPaginationModule

],
providers: ,
bootstrap: [AppComponent]
})
export class AppModule {

}





share|improve this answer













I guess you have a HomeComponent that is not declared in any module?



Try to add HomeComponent in your AppModule declarations



@NgModule({
declarations: [
AppComponent,
HomeComponent
],
imports: [
BrowserModule,
FormsModule,
NgxPaginationModule

],
providers: ,
bootstrap: [AppComponent]
})
export class AppModule {

}






share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 22 '18 at 16:07









TooLiPHoNe.NeTTooLiPHoNe.NeT

1271112




1271112













  • the actual error is this

    – Abhayjeet Singh
    Nov 22 '18 at 16:24











  • ERROR in ./src/app/app.component.ngfactory.js Module not found: Error: Can't resolve '../../node_modules/ngx-Pagination/dist/ngx-pagination.ngfactory' in 'D:paginationdemosrcapp'

    – Abhayjeet Singh
    Nov 22 '18 at 16:24



















  • the actual error is this

    – Abhayjeet Singh
    Nov 22 '18 at 16:24











  • ERROR in ./src/app/app.component.ngfactory.js Module not found: Error: Can't resolve '../../node_modules/ngx-Pagination/dist/ngx-pagination.ngfactory' in 'D:paginationdemosrcapp'

    – Abhayjeet Singh
    Nov 22 '18 at 16:24

















the actual error is this

– Abhayjeet Singh
Nov 22 '18 at 16:24





the actual error is this

– Abhayjeet Singh
Nov 22 '18 at 16:24













ERROR in ./src/app/app.component.ngfactory.js Module not found: Error: Can't resolve '../../node_modules/ngx-Pagination/dist/ngx-pagination.ngfactory' in 'D:paginationdemosrcapp'

– Abhayjeet Singh
Nov 22 '18 at 16:24





ERROR in ./src/app/app.component.ngfactory.js Module not found: Error: Can't resolve '../../node_modules/ngx-Pagination/dist/ngx-pagination.ngfactory' in 'D:paginationdemosrcapp'

– Abhayjeet Singh
Nov 22 '18 at 16:24


















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53433950%2fwhy-angular-6-app-throwing-error-while-deploying-for-production%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Costa Masnaga

Fotorealismo

Sidney Franklin