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

Preparing for a certification exam? Ask exam experts all your questions on May 15th. 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?

55 REPLIES 55
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

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.

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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

Top Solution Authors