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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
OnSignTV
Advocate I
Advocate I

TypeError: Cannot read properties of undefined (reading 'tokenType')

Hi!

 

We recently started have issues loading some Embedded PowerBI embedded dashboards.

 

TypeError: Cannot read properties of undefined (reading 'tokenType')
at isSaaSEmbedWithAADToken (reportEmbed?reportId…d&uid=cslgcq:586:38)
at getModelsAndExploration (reportEmbed?reportId…d&uid=cslgcq:696:17)
at getModelsAndExplorationAndConceptualSchema (reportEmbed?reportId…3d&uid=cslgcq:840:9)
at xhr.onreadystatechange (reportEmbed?reportId…d&uid=cslgcq:505:37)
getModelsAndExploration @ reportEmbed?reportId…0%3d&uid=cslgcq:739

 

Here is an Stack Overflow user reporting the exact same issue, from 2 days ago. He took a look into the implementation and even found the source of the bug.

 

https://stackoverflow.com/questions/78592107/typeerror-cannot-read-properties-of-undefined-reading-t...

 

The exception is coming from the lack of a "config" parameter when calling the internal isSaaSEmbedWithAADToken function.

 

This is affecting our users because their dashboards fail to be displayed correctly.

 

Is there anything that can be done on our side?

9 REPLIES 9
v-shex-msft
Community Support
Community Support

Hi @OnSignTV,

I find the this issue is closed at github issue page. For this scenario, I'd like to suggest you try again to confirm if it fixed.

TypeError: Cannot read properties of undefined (reading 'tokenType') · Issue #66 · microsoft/powerbi...

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
allenwilson
New Member

I'm having the same problem.  After this error occurrs, I then see numerous other 403 errors (see errors below). 

All of this is recent and impacting both embedded PowerBI reports.  An updates on when this will be resolved and/or what we can do to resolve it?

 

TypeError: Cannot read properties of undefined (reading 'tokenType')
at isSaaSEmbedWithAADToken
at getModelsAndExploration
at getModelsAndExplorationAndConceptualSchema
at startFrontLoadReportEmbed
at receiveMessage


Failed to load resource: the server responded with a status of 403 ()
wabi-us-central-a-primary-redirect.analysis.windows.net/powerbi/metadata/models/5079221/?modelOptions=Default:1


Failed to load resource: the server responded with a status of 403 ()
wabi-us-central-a-primary-redirect.analysis.windows.net/powerbi/metadata/models/5480624/?modelOptions=Default:1


Failed to load resource: the server responded with a status of 403 ()
wabi-us-central-a-primary-redirect.analysis.windows.net/powerbi/metadata/models/5543953/?modelOptions=Default:1

.... a couple dozen more appear like the ones above with different model numbers.

Chrissa
Frequent Visitor

We are experiencing the same issue; several screens with Power BI reports are affected. Hope Microsoft are able to fix this asap.

isdanielfraser
Regular Visitor

We are also having this issue. We run many devices on older chrome versions and this has affected quite a few clients. Updating webkit on devices where we are able to has resolved some issues. However, most clients are on below chrome 94 and are unable to update webkit. 

v-shex-msft
Community Support
Community Support

Hi @OnSignTV ,

Can you please share some more detail information about this issue? They should help us clarify your scenario and test to troubleshoot.

How to Get Your Question Answered Quickly  

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Hi,

From my investigation, I have found that the powerbi embed works as expected in chrome version 94 and onwards but fails in older version than that. The above error appears in all versions of chrome but the reports show up fine in version 94 and onwards in spite of the error.

Hi there!

 

There is a bug in the page returned by the "embed_url" of a dashboard.

 

If you search for this function:

 

function isSaaSEmbedWithAADToken(config) {
// Default token type is Aad (0)
const tokenType = config.tokenType || 0;
return (window.isSaasOrPaasEmbed === true) && (tokenType === 0);
}

 

You will see that there is one location where it is called without the required config parameter:

 

if (isSaaSEmbedWithAADToken() && config.settings && config.settings.personalBookmarksEnabled) {
url += "&defaultBookmarkEnabled=true";
}

 

Which causes this exception:

 

TypeError: Cannot read properties of undefined (reading 'tokenType')
at isSaaSEmbedWithAADToken (reportEmbed?reportId…d&uid=cslgcq:586:38)
at getModelsAndExploration (reportEmbed?reportId…d&uid=cslgcq:696:17)
at getModelsAndExplorationAndConceptualSchema (reportEmbed?reportId…3d&uid=cslgcq:840:9)
at xhr.onreadystatechange (reportEmbed?reportId…d&uid=cslgcq:505:37)
getModelsAndExploration @ reportEmbed?reportId…0%3d&uid=cslgcq:739

 

All this happens inside the page returned by the embed_url, so it happens regardless of my code or how I initialize the client library.

 

So this seems to be an internal bug of PowerBI. One that was introduced fairly recently, because this exception did not happen a couple of weeks ago.

 

I am having the same issue and noticed at around the same time as the thread on stackoverflow was open. I also confirmed that this is also happening in previous versions of our software where it didn't happen before. My problem isn't as bad as your since I am using embed instead of aad, but it does seem like a problem on Microsofts side.

facing the same issue, btw how did you see those internal functions.

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

July Newsletter

Fabric Community Update - July 2024

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