Why Angular 6 app throwing error while deploying for production?
up vote
0
down vote
favorite
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
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
|
show 7 more comments
up vote
0
down vote
favorite
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
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
You need to share some code. It is hard to say anything with this little information.
– Bunyamin Coskuner
Nov 22 at 15:19
So, your referring to thecollection
in the app component, but declaring and populating thecollection
in the app module class? Is that working for you?
– R. Richards
Nov 22 at 15:52
please check now
– Abhayjeet Singh
Nov 22 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 at 16:00
means.........?
– Abhayjeet Singh
Nov 22 at 16:01
|
show 7 more comments
up vote
0
down vote
favorite
up vote
0
down vote
favorite
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
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
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
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
angular angular5 angular6
edited Nov 22 at 16:17
asked Nov 22 at 15:17
Abhayjeet Singh
217
217
You need to share some code. It is hard to say anything with this little information.
– Bunyamin Coskuner
Nov 22 at 15:19
So, your referring to thecollection
in the app component, but declaring and populating thecollection
in the app module class? Is that working for you?
– R. Richards
Nov 22 at 15:52
please check now
– Abhayjeet Singh
Nov 22 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 at 16:00
means.........?
– Abhayjeet Singh
Nov 22 at 16:01
|
show 7 more comments
You need to share some code. It is hard to say anything with this little information.
– Bunyamin Coskuner
Nov 22 at 15:19
So, your referring to thecollection
in the app component, but declaring and populating thecollection
in the app module class? Is that working for you?
– R. Richards
Nov 22 at 15:52
please check now
– Abhayjeet Singh
Nov 22 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 at 16:00
means.........?
– Abhayjeet Singh
Nov 22 at 16:01
You need to share some code. It is hard to say anything with this little information.
– Bunyamin Coskuner
Nov 22 at 15:19
You need to share some code. It is hard to say anything with this little information.
– Bunyamin Coskuner
Nov 22 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 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 at 15:52
please check now
– Abhayjeet Singh
Nov 22 at 15:52
please check now
– Abhayjeet Singh
Nov 22 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 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 at 16:00
means.........?
– Abhayjeet Singh
Nov 22 at 16:01
means.........?
– Abhayjeet Singh
Nov 22 at 16:01
|
show 7 more comments
1 Answer
1
active
oldest
votes
up vote
1
down vote
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 {
}
the actual error is this
– Abhayjeet Singh
Nov 22 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 at 16:24
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
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 {
}
the actual error is this
– Abhayjeet Singh
Nov 22 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 at 16:24
add a comment |
up vote
1
down vote
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 {
}
the actual error is this
– Abhayjeet Singh
Nov 22 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 at 16:24
add a comment |
up vote
1
down vote
up vote
1
down vote
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 {
}
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 {
}
answered Nov 22 at 16:07
TooLiPHoNe.NeT
1271112
1271112
the actual error is this
– Abhayjeet Singh
Nov 22 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 at 16:24
add a comment |
the actual error is this
– Abhayjeet Singh
Nov 22 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 at 16:24
the actual error is this
– Abhayjeet Singh
Nov 22 at 16:24
the actual error is this
– Abhayjeet Singh
Nov 22 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 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 at 16:24
add a comment |
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.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- 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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
You need to share some code. It is hard to say anything with this little information.
– Bunyamin Coskuner
Nov 22 at 15:19
So, your referring to the
collection
in the app component, but declaring and populating thecollection
in the app module class? Is that working for you?– R. Richards
Nov 22 at 15:52
please check now
– Abhayjeet Singh
Nov 22 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 at 16:00
means.........?
– Abhayjeet Singh
Nov 22 at 16:01