ionic-typeorm-starter icon indicating copy to clipboard operation
ionic-typeorm-starter copied to clipboard

Hotfix: Changes to the async initialization sequence,

Open StephaneSeyvoz opened this issue 6 years ago • 0 comments

Hotfix: Changes to the async initialization sequence

Checked using Ionic 5.4.4 and Cordova 9.0.0 installed globally, deploying on an Android 9 (API level 28) emulator and an Android 7 device, both in 'dev' and 'prod' profiles.

This solves the

'ERROR …Error: Uncaught (in promise): RepositoryNotFoundError: No repository for "post" was found. Looks like this entity is not registered in current default connection?'

error, happening because the getRepository('post') call in home.page would happen before the TypeORM connection created by the db.service was ready, despite trying to wait for its initialization in app.component.

This is of course just a suggestion of correction, feel free to adapt as you wish.

StephaneSeyvoz avatar Oct 16 '19 17:10 StephaneSeyvoz