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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
kjohnson
New Member

call to getPages() throws error in powerbi-client: Cannot read property 'map' of undefined

Hello,

 

We've been using the Phased Embedding API (https://github.com/Microsoft/PowerBI-JavaScript/wiki/Phased-Embedding-API) in order to pick the report page dynamically in the client for a few weeks now without issue. Today, it appears that the getPages() request is no longer returning a body, so we get the following error: `Uncaught (in promise) TypeError: Cannot read property 'map' of undefined` pointing us to the powerbi-client src:

 

e.prototype.getPages = function() {
  var t = this;
  return this.service.hpm.get("/report/pages", {
    uid: this.config.uniqueId
  }, this.iframe.contentWindow).then(function(e) {
    return e.body.map(function(e) {
      return new l.Page(t,e.name,e.displayName,e.isActive,e.visibility)
    })
  }, function(t) {
    throw t.body
  })
}

 

 

The response we get `e` is defined as:

 

 

{"warning":"Handler for message: {\n \"method\": \"GET\",\n \"url\": \"/report/pages\",\n \"headers\": {\n \"x-sdk-type\": \"js\",\n \"x-sdk-version\": \"2.6.6\",\n \"uid\": \"z65rk\",\n \"id\": \"l0g7p\"\n },\n \"params\": {},\n \"queryParams\": {}\n} did not return a response message. The default response message will be returned instead.","headers":{"id":"l0g7p"}}

 

`e.body` is not defined, so `e.body.map` blows up. 

 

Our implementation of the API has been working fine until today, and looks as follows:

 

 

var t = e.instance.load(e.wrapper, e.config);
t.on("loaded", function() {
  t.getPages().then(function(n) {
    for (var a = 0; a < n.length; a += 1)
      if (n[a].displayName === e.report.pageName) {
        t.render({
          pageName: n[a].name
        });
        break
     }
  })
})

 

 

It appears that this might be an issue with the v2.6.6 embed API, but all status options we can see reflect PowerBI as operating normally. Any insights/help would be much appreciated.

0 REPLIES 0

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.