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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
HasnainNutkani
Advocate I
Advocate I

Uncaught ReferenceError: ClipboardItem is not defined

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?

1 ACCEPTED SOLUTION

I think the thread can be closed. MS fixed it. Thanks

View solution in original post

57 REPLIES 57
v-tsaipranay
Community Support
Community Support

Hi @HasnainNutkani ,

 

I am following up to see if the issue previously identified as a known concern on Microsoft's end has been resolved for you.

If it has been resolved, we would appreciate any relevant insights you could share. Otherwise, we will proceed to close this thread.

For any future assistance, please feel free to post a new query in the Microsoft Fabric Community Forum. We are here to help you.

 

Thank you for your understanding and participation.

I think the thread can be closed. MS fixed it. Thanks

v-tsaipranay
Community Support
Community Support

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.

 

Paul-ROM-BI
New Member

This appears resolved by Microsoft for my clients.

Paul-ROM-BI
New Member

This appears resolved by Microsoft for my clients.

Amaro2000
New Member

The issue seems to be solved on our side. Dashboards are loading again within an Iframe. Can you check again?

RogelioGlez
Regular Visitor

I have de same problem. We cannot simply bypass with HTTPS.

Anyone have official announcement link from Microsoft regarding this issue?

jameslo30
Advocate III
Advocate III

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.

MatheusLPS
Helper I
Helper I

Here too

MatheusLPS_0-1745511663015.png

 

jorgegil
New Member

Same

syedizharLL
New Member

Anyone have official announcement link from Microsoft regarding this issue?

gizmogaurav
New Member

Not working for me too . It was few weeks before and suddenly stop working

cmactiveworx
New Member

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.

PowerrrRon
New Member

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

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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