Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
MattCalderwood
Responsive Resident
Responsive Resident

Error calling page 'hasLayout' in embedding JavaScript Client - v2.9.0 +

Hi All,

I had working code that was succesfully calling the page.hasLayout function - to check to see if a report had a mobile layout.
As of yesterday (5th Oct 2019) - this code no longer works, and an odd Angular error appears in the browser console.

I have not changed my code at all. 
Attempted to update JavaScript client version to latest 2.10.1 -> but issue still exists.

Sample Code:

report.getPages()
.then((page: Array<pbi.Page>) => {
        page[0].hasLayout(models.LayoutType.MobilePortrait)....

GetPages works just fine, page array contains expected report pages.
Selecting first page (by 0 index) and calling hasLayout results in error.

Error caused by using 'hasLatout' on page object.Error caused by using 'hasLatout' on page object.
Looking at Angular docs (I am not an Angular dev) - it looks like a possible missing dependency?
https://docs.angularjs.org/error/$injector/unpr 

Could this be an issue with the scripts being served up from api.powerbi.com (as in the error screenshot) ?

Any help is very much appreciated.
Thanks,

Matt

1 ACCEPTED SOLUTION

@MattCalderwood , @Dan2  : I got word from support that the fix has been deployed. I have tested and it looks good.

 

 

View solution in original post

10 REPLIES 10
tusharvaja
Employee
Employee

Power BI team is working on the fix. It should be fixed in all production clusters by 10/23. As a mitigation you can remove the use of 'hasLayout' and embed with MobilePortrait/MobileLandscape. In this way, if the MobilePortrait does not exist the default layout will be rendered instead. 

Thanks @tusharvaja  for the update.

@MattCalderwood , @Dan2  : I got word from support that the fix has been deployed. I have tested and it looks good.

 

 

Norm
Advocate I
Advocate I

I've been told by support that a fix will be out in the second week of November.

Yikes - that feels like a long time to wait.. but thanks again for keep us all updated @Norm  - really appreciate it.

 

Dan2
Helper I
Helper I

Having the same issue as poster and everyone else. Any updates would be appreciated. Thanks.

Norm
Advocate I
Advocate I

We have the same problem as you. Everything was working perfectly and since the end of last week we have the same error. As you said, the problem must be with the api.powerbi.com scripts because even the sample tool ( https://microsoft.github.io/PowerBI-JavaScript/demo/v2-demo/index.html# ) have the same error on the Check Layout sample. 

 

I would be great if the PowerBI Team could look this up!

 

Good to see it's not just me who is having the issue, well done @Norm for confirming it using the official sample tool code.

now just need confirmation (and fix) from the Power BI team.

@MattCalderwood  I've opened a ticket and talked with someone from the support team. They are going to look into this.

Excellent - thanks for keeping me updated.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Kudoed Authors