nativescript-angular icon indicating copy to clipboard operation
nativescript-angular copied to clipboard

Android APP_INITIALIZER Cannot read property 'nativeView' of undefined

Open standevo opened this issue 5 years ago • 0 comments

Environment

  • NS: 7.0.11
  • Android: 10
  • Angular CLI: 10.2.0
  • Angular: 10.1.6

Describe the bug Using APP_INITIALIZER on Android I run into the issue (on IOS works fine): JS: ERROR TypeError: Cannot read property 'nativeView' of undefined

To Reproduce

  • tns create myAPP
  • Select angular & side-drawer template

Add in app.module.ts

providers: [
        {
            provide: APP_INITIALIZER,
            useFactory: () => {
                return () =>
                    new Promise((resolve) => {
                        setTimeout(() => {
                            resolve();
                        }, 1000);
                    });
            },
            multi: true,
        },
    ]

main.ts

platformNativeScriptDynamic({
    async:true,
}).bootstrapModule(AppModule);

standevo avatar Nov 03 '20 21:11 standevo