Skip to content

Android APP_INITIALIZER Cannot read property 'nativeView' of undefined #2289

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
standevo opened this issue Nov 3, 2020 · 0 comments
Open

Comments

@standevo
Copy link

standevo commented Nov 3, 2020

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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant