Issue with Embedded API - Cannot read property 'map' of undefined

Status: Delivered
by MattCalderwood Frequent Visitor on ‎02-04-2019 06:49 AM



We have started getting the error 'Cannot read property 'map' of undefined'.
This occurs on our production app via the embedded API when trying to get the report pages.

We have found the code within the Power BI Javascript client - which makes a call to the internal REST API's - but the response comes back empty...

	     * Gets the list of pages within the report.
	     * ```javascript
	     * report.getPages()
	     *  .then(pages => {
	     *      ...
	     *  });
	     * ```
	     * @returns {Promise<Page[]>}
	    Report.prototype.getPages = function () {
	        var _this = this;
	        return this.service.hpm.get('/report/pages', { uid: this.config.uniqueId }, this.iframe.contentWindow)
	            .then(function (response) {
	            return response.body
	                .map(function (page) {
	                return new page_1.Page(_this,, page.displayName, page.isActive, page.visibility, page.defaultSize, page.defaultDisplayOption);
	        }, function (response) {
	            throw response.body;

The line....

return response.body
	                .map(function (page) {

Fails due to the object 'response.body' being undefined.

I have tested this functionality within the Power BI playground - but it appears to be working OK here.
This is a production app that has not been modified in the last few weeks - so is not a code change from our side.

Reports are rendering without issue - and all other functionality appears to be OK.

Our 365 Tennant is 'North Europe' - but the embedded capacity is located in UK South.

Is there a known issue with the API endpoints in either of these locations?


Status: Delivered
by MattCalderwood Frequent Visitor
on ‎02-04-2019 07:16 AM

additional details.....
The Javascript error detail from the response object is as follows.

"Handler for message: {↵ "method": "GET",↵ "url": "/report/pages",↵ "headers": {↵ "x-sdk-type": "js",↵ "x-sdk-version": "2.7.1",↵ "uid": "5qxyv",↵ "id": "v5xwm"↵ },↵ "params": {},↵ "queryParams": {}↵} did not return a response message. The default response message will be returned instead."

by Community Support Team
on ‎02-04-2019 11:36 PM

Hi Matt,


Since you didn't make any changes, I don't need to ask for the code. Everything seems great. I would suggest you try the latest powerbi-client. I would also suggest you file a support ticket here.



Best Regards,


by MattCalderwood Frequent Visitor
on ‎02-05-2019 12:56 AM

Thanks @v-jiascu-msft


Our production app is on client 2.6.7 -> but I have tested locally with the latest version (2.7.1).
The source code for this particular function hasn't changed within the client, which leads me to there being an issue at the service end.


I will raise a ticket.




by malcuch Occasional Visitor
on ‎02-05-2019 04:39 AM

I confirm have the same issue. It appeared of the blue couple of days ago, 2 days before UATs... Nothing changed in out codebase. Tested on the 2.7.1 JS client library. We found out that error is generated in the javascript library loaded into report embed iframe, from the EmbedReport.js file.






by MattCalderwood Frequent Visitor
on ‎02-05-2019 05:09 AM

Hi @malcuch

I have a suppport ticket open with the PowerBI team. 
I will post the outcome back here as soon as I know anything more.

by malcuch Occasional Visitor
on ‎02-05-2019 05:11 AM

@MattCalderwoodThank you.

by GaleGartling Visitor
on ‎02-05-2019 06:57 AM

We are having the same problem.  It started sometime between 5:30PM EST on Friday Feb 1 and  9:30 AM EST Saturday Feb 2.  We had no code changes in the time this occurred.  We would also like to see any outcome.  Thank you!

by MattCalderwood Frequent Visitor
on ‎02-05-2019 08:04 AM

Just heard back from support.

The product team have found the issue and are preparing to deploy a fix. 


No fixed ETA on this at the moment, but apparently it will feature on the support page soon. 

Fingers crossed things will be back to normal shortly.




cc. @malcuch @GaleGartling

by GaleGartling Visitor
on ‎02-05-2019 09:03 AM

@MattCalderwood Thank you.  I can see this message on the support site now.  Hopefully it is resolved soon.


Customers who are using phased loading in the Report Embed scenario and also use report.getPage/report.setPage before the report is rendered will fail with a "TypeError: Cannot read property 'map' of undefined" error. Using report.getPage/report.setPage after the report is rendered works as expected. Engineers are working on a fix and will provide an ETA soon.

by Community Support Team
on ‎02-11-2019 05:18 PM

Dear All,


This issue has been fixed. Please check out.


Best Regards,


Idea Statuses