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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.