Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers!
Enter the sweepstakes now!Preparing for a certification exam? Ask exam experts all your questions on May 15th. Register now.
I've integrated Power BI reports into a web application, and everything has been working smoothly for the past three years. However, all of a sudden, I'm encountering the following error in the browser console:
Uncaught ReferenceError: ClipboardItem is not defined.
This error appears when calling the following method:
report = powerbi.embed(embedContainer, config);
Could someone please help me understand and resolve this issue?
Hi @HasnainNutkani ,
Since it is known issue from microsoft end may I know is it resloved? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.
Thank you.
This appears resolved by Microsoft for my clients.
This appears resolved by Microsoft for my clients.
The issue seems to be solved on our side. Dashboards are loading again within an Iframe. Can you check again?
I have de same problem. We cannot simply bypass with HTTPS.
Anyone have official announcement link from Microsoft regarding this issue?
Same problem in our enviroment. We cannot simply bypass with HTTPS.
I do not want support hoops to jump through. The problem is clearly not our side.
Here too
Same
Anyone have official announcement link from Microsoft regarding this issue?
Not working for me too . It was few weeks before and suddenly stop working
Just got off the phone with Microsoft support. They have an internal product bug logged already and are working on a fix that is estimated to be deployed either this Friday or next. The main workaround as many have already mentioned is switching to https or using the chrome hack that was also mentioned in this thread.
any update from microsoft
Do you have any official announement link or ticket number to track?
I asked for one but they would not give one and said it was already logged internally as a product bug. A pain I know but I will just be happy when they fix it. I will be checking in with my support rep if it is not fixed next week.
It's a bug in the powerbi script. It should check if ClipboardItem is available because it isn't always there. Microsoft forgot to put it inside a try/catch clause. ClipboardItem is not defined when:
- http:// is used in chromium without localhost- cross-origin iframes (when you load powerbi using the javascript client api)
Another solution for MS is to put this code at the start of the injected iframe to mock the clipboard:
if (typeof ClipboardItem == 'undefined') {
ClipboardItem = window.ClipboardItem = function (items) {
return items;
};
}
This is not possible to do yourself when you are embedding Powerbi inside your own website. That is because the cross-origin settings do not allow injecting javascript in the iframe. So I'm not able to produce a workaround for that situation.
It's only possible when using playwright:
await context.addInitScript(`
if (typeof ClipboardItem == 'undefined') {
ClipboardItem = window.ClipboardItem = function (items) {
return items;
};
}
`);
Can we modify the Power BI client script, host it ourselves, and use it as a package?
No that won't work. The PBI client javascript injects an iframe to the document. And the problem is -inside- the iframe. The outer document does not execute the script that is throwing the error, that one is only executed inside the iframe.
If you are using this inside https the issue is no longer throwing up, which is a temporary workaround as per Microsoft
You are right. I've updated my comment.
We are also trying the same, but the web server load will be higher and it's not cost-effective.
Check out the April 2025 Power BI update to learn about new features.
Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.
User | Count |
---|---|
16 | |
13 | |
7 | |
5 | |
4 |