The current code is using both a direct call of powerbi.embed() before the DOMContentLoaded event and an indirect call using powerbi.init() after DOMContentLoaded.
The second call through powerbi.init() will internally cause call to embedExisting since there is a report already embedded in the element which then requires the configuration to be passed explicitly. This defaults to an empty object which does not have an accessToken and this fails validation.
The current code is using both a direct call of
powerbi.embed()
before theDOMContentLoaded
event and an indirect call usingpowerbi.init()
afterDOMContentLoaded
.The second call through
powerbi.init()
will internally cause call toembedExisting
since there is a report already embedded in the element which then requires the configuration to be passed explicitly. This defaults to an empty object which does not have an accessToken and this fails validation.