Model-drive app no longer accessible: "Cannot read property 'libraryId' of undefined"

This post will cover a recent problem I faced when accessing our main model-driven app. The issue affected our Sales Team Member app in the production environment, where I could no longer access the app regardless of the user's access level.

Two different error messages were being returned, depending on the user's security permissions:

Cannot read property 'libraryId' of undefined – when accessing by a Team Member
PowerAppsHostingSdk.InitializeAzync time out – when accessing by an Admin user

First, let's reproduce the problem. MS recently released a new app designer still in preview mode that will help with the customization of menus and navigation bars, including the support to the fresh-baked PowerFx.

Edit a model-driven app with the modern design (preview) mode

However, things went a bit off-hand when several people started reporting they could no longer access their model-driven app. The cause seems to be related to a Component library (preview) that is automatically created when the option Edit command bar (preview) is opened even if you don't make any changes:

Opening the Command bar (preview) editor
The component library is created automatically

And the mess is done:

Cannot read property 'libraryId' of undefined

I had a two-week urgent ticket opened with MS, and this is the final response: "Solution: Issue was found to be a Bug and was fixed from backend".

So, if the problem happened with the Sales Team Member app, there's no much to be done, since this app is unique and cannot be replaced. Open an MS ticket and hopefully, the solution will come faster than that.

However, there are some things you can do meanwhile:

  • To still be able to access the defective app, add &flags=FCB.EnableAppActions=false at the end of the URL. This will bypass the loading of the custom command bar actions;
  • If the problem happened with a custom app, just create a new model-driven app using the same site map as the defective one. You can keep using this new app while MS solves your problem.

This problem is likely to no longer happen in the near future, but I decided to make it available here to help whoever needs it.

Never stop learning!

Cassio Milanelo

Skilled and self-motivated Dynamics 365 CE developer and Power Platform jack of all trades. Acknowledged for high productivity and enthusiasm. Slightly workaholic and coffee lover ☕