Forum Discussion
TypeError: Cannot read properties of undefined (reading 'tokenType')
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
- OnSignTV2 years agoAdvocate I
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:739All 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.
- Anonymous2 years agoNot applicable
facing the same issue, btw how did you see those internal functions.
- chaimite2 years agoNew Member
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.
- sshrestha2 years agoRegular Visitor
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.