-
-
Notifications
You must be signed in to change notification settings - Fork 23
Closed
Description
From @ignaciolarranaga on January 12, 2017 12:16
I added the plugin to my app and the npm android start-android-bundle stared throwing this error:
ERROR in Unexpected value 'NSFRESCO_DIRECTIVES' declared by the module 'MainModule'
ERROR in ./main.aot.ts
Module not found: Error: Can't resolve './app.module.ngfactory' in '/Users/ignacio/Workspaces/DuenoVende/hezea-app/app'
@ ./main.aot.ts 2:0-60
ERROR in ../~/nativescript-angular/router/ns-module-factory-loader.js
Module not found: TypeError: Cannot convert undefined or null to object
@ ../~/nativescript-angular/router/ns-module-factory-loader.js 23:15-40
@ ../~/nativescript-angular/router.js
@ ./vendor.ts
ERROR in ../~/nativescript-angular/router/ns-module-factory-loader.js
Module not found: TypeError: Cannot convert undefined or null to object
@ ../~/nativescript-angular/router/ns-module-factory-loader.js 29:27-46
@ ../~/nativescript-angular/router.js
@ ./vendor.ts
I follow the instructions on the plugin to modify my app (that was actually starting correctly):
- Import the NSFRESCO_DIRECTIVES from nativescript-fresco/angular and add it to the declarations of your initial @NgModule, like shown here.
- As described above make sure to initialize the nativescript-fresco plugin in the launch event of your {N} application.
To reproduce may be the best is with the nativescript-alfresco demo app, but there are some additional issues with webpack to solve there.
Here is my code:
import { NgModule, NO_ERRORS_SCHEMA } from "@angular/core";
import { Http } from "@angular/http";
import { TranslateModule, TranslateLoader, TranslateStaticLoader } from "ng2-translate";
import { NativeScriptModule } from "nativescript-angular/platform";
import { NativeScriptFormsModule } from "nativescript-angular/forms"
import { NativeScriptRouterModule } from "nativescript-angular/router";
import { NativeScriptHttpModule } from "nativescript-angular/http";
import { NSFRESCO_DIRECTIVES } from 'nativescript-fresco/angular';
import { ActionBarModule } from "../../components";
import { PropertyComponent } from "./property/property.component";
import { MainPage } from "./main.component";
@NgModule({
schemas: [ NO_ERRORS_SCHEMA ],
imports: [
NativeScriptModule,
NativeScriptFormsModule,
NativeScriptRouterModule,
NativeScriptRouterModule.forChild([ { path: "", component: MainPage } ]),
TranslateModule,
ActionBarModule,
],
declarations: [ NSFRESCO_DIRECTIVES, MainPage, PropertyComponent ]
})
export class MainModule {}
It is a lazy loaded module. The initialization of fresco is in the main component.
Copied from original issue: NativeScript/nativescript-dev-webpack#53