I have a Nativescript angular project. After it became ready for publishing I installed webpack for nativescript. When I run npm run build-android-bundle it gives me component is not a known element error:
````
ERROR in Template parse errors:
'image' is not a known element:
<Tex"): ng:///home/zarax/code/cubicl-mobile/app/pages/login/login.html@2:2
'FlexboxLayout' is not a known element:
ERROR in ./main.aot.ts
Module not found: Error: Can't resolve './app/app.module.ngfactory' in '/home/zarax/code/cubicl-mobile/app'
@ ./main.aot.ts 5:29-66
````
I searched the internet but couldn't find a solution.
My tns-android version is 3.2.0. ngtools/webpack version is 1.6.0.
Thanks
I found the solution. You have to put NO_ERRORS_SCHEMA to all custom NgModule declarations:
ts
import { NgModule, NO_ERRORS_SCHEMA } from '@angular/core';
ts
@NgModule({
// ...
schemas: [
NO_ERRORS_SCHEMA
]
})
This is not needed for building project without webpack and not mentioned on nativescript webpack documentation. This should be added to documentation to prevent confusion.
I found the solution. You have to put NO_ERRORS_SCHEMA to all custom NgModule declarations:
import { NgModule, NO_ERRORS_SCHEMA } from '@angular/core';@NgModule({ // ... schemas: [ NO_ERRORS_SCHEMA ] })This is not needed for building project without webpack and not mentioned on nativescript webpack documentation. This should be added to documentation to prevent confusion.
Works for me!
Most helpful comment
I found the solution. You have to put NO_ERRORS_SCHEMA to all custom NgModule declarations:
ts import { NgModule, NO_ERRORS_SCHEMA } from '@angular/core';ts @NgModule({ // ... schemas: [ NO_ERRORS_SCHEMA ] })This is not needed for building project without webpack and not mentioned on nativescript webpack documentation. This should be added to documentation to prevent confusion.