cancel
Showing results for 
Search instead for 
Did you mean: 

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

Hi,

 

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.name, 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?
Thanks,

Matt

Status: Delivered
Comments
Frequent Visitor

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."

Super Contributor

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.

create-ATicket

 

Best Regards,

Dale

Frequent Visitor

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.

Cheers,

 

Matt

Occasional Visitor

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.

 

 

 

 

 

Frequent Visitor

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.

Occasional Visitor

@MattCalderwoodThank you.

Frequent Visitor

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!

Frequent Visitor

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.
https://powerbi.microsoft.com/en-us/support/ 

Fingers crossed things will be back to normal shortly.

 

 

 

cc. @malcuch @GaleGartling

Frequent Visitor

@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.

Super Contributor

Dear All,

 

This issue has been fixed. Please check out.

 

Best Regards,

Dale