Skip to content
This repository has been archived by the owner on Aug 7, 2021. It is now read-only.

Problems integrating nativescript-fresco #53

Closed
ignaciolarranaga opened this issue Jan 12, 2017 · 1 comment
Closed

Problems integrating nativescript-fresco #53

ignaciolarranaga opened this issue Jan 12, 2017 · 1 comment

Comments

@ignaciolarranaga
Copy link

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.

@hdeshev
Copy link
Contributor

hdeshev commented Jan 12, 2017

This issue was moved to NativeScript/nativescript-fresco#28

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants