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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
v-jiascu-msft
Employee
Status changed to: Delivered