Forum Discussion
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?
I think the thread can be closed. MS fixed it. Thanks
57 Replies
- cmactiveworxNew 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.
- syedizharLLNew Member
Do you have any official announement link or ticket number to track?
- cmactiveworxNew Member
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.
- bill4002024Regular Visitor
any update from microsoft
- punithv050New Member
Uncaught ReferenceError: ClipboardItem is not defined - Power BI Embed in WebView Suddenly Failing
Hi Power BI Community,We've been using Power BI embedded reports inside a production application via WebView for quite a while now - everything was stable. However, very recently, we've started encountering the following error in the browser console:
Uncaught ReferenceError: ClipboardItem is not defined
This error is triggered at the point of embedding the report using:
report = powerbi.embed(embedContainer, config);
Key Notes:
- Our application setup hasn’t changed - same config, same environment, and same WebView.
- This error only started appearing recently, possibly due to a change in the Power BI SDK (reportEmbed.min.js) or related service.
- Appears to be related to the Clipboard API - specifically ClipboardItem, which is not supported in some WebView contexts or over HTTP.
Community Echoes:
I noticed other developers are facing the exact issue across different platforms and embedding methods:
- Long-running web apps suddenly breaking due to this error, without any recent code changes.
- WPF applications using WebView2 now require serving the HTML file over HTTPS to work.
- Issue seems tied to updates in Power BI's embed SDK - possibly stricter Clipboard API enforcement.
- Some reports confirm that switching to HTTPS resolved the issue, even when HTTP worked fine before.
What I'm looking for:
- Has there been an official change or announcement from Microsoft regarding Clipboard API enforcement in the embed SDK?
- Any workaround to suppress or bypass ClipboardItem usage if clipboard functionality isn't needed?
- Can the Power BI product team confirm if reportEmbed.min.js was recently updated with breaking changes?
This issue is currently affecting our internal dashboards across environments. Any clarity or guidance would be greatly appreciated.
Thanks in advance!
- Puneeth - PowerrrRonNew 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;
};
}
`);- niyas7204Regular Visitor
Can we modify the Power BI client script, host it ourselves, and use it as a package?
- PowerrrRonNew Member
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.
- AnonymousNot applicable
Hi HasnainNutkani ,
Thank you for reaching out to the Microsoft Fabric Community.
The error message Uncaught ReferenceError: ClipboardItem is not defined is not caused by the Power BI JavaScript embedding functionality itself. Rather, it originates from usage of the Clipboard API specifically the ClipboardItem interface which is a browser-provided feature not supported in all environments.
This API is not part of the Power BI SDK, so the error is likely coming from custom application code or a third-party script that is being executed alongside or during the embedding process. As your integration has been stable for years, it’s possible that a recent change such as a browser update, added dependency, or modification in your app introduced this usage. It's also important to ensure the application is running in a secure (HTTPS) context and in a browser that supports the Clipboard API.
If the Power BI reports are rendering correctly and the error is only appearing in the console, it may be a non-blocking issue. However, if the embedding is being affected, we recommend reviewing any recent changes made to your app or libraries and checking the browser’s developer tools to locate the specific source of the error.
I hope this will resolve your issue, if you need any further assistance, feel free to reach out.
If this post helps, then please give us Kudos and consider Accept it as a solution to help the other members find it more quickly.
Thankyou.
- lctrungNew Member
My Power BI report is experiencing the same issue as others have mentioned. I'm using the "Publish to web" feature and embedding the report into an iframe within an HTTP page, and it consistently throws the following error: " reportEmbed.min.a7c6…b29f00692e27c5.js:1 Uncaught ReferenceError: ClipboardItem is not defined"
This issue occurred suddenly, without any updates or changes on my side. The report had been working fine for over a month.
However, when I switched the embedding page to use HTTPS, the report loads without any problem.
Could you please assist in resolving this issue quickly or advise on a workaround for HTTP environments?
Thank you very much for your support.
- AugustoChavesAdvocate II
+1 affected as well
- WilliamCrokeNew Member
From my main response to this post, it appears to be part of the Power BI Embedded environment.
- punithv050New Member
Yes, I'm aslo facing similar issue
- husnainnutkaniNew Member
Thanks for your response. Let me add that we are using HTTP, and some users in our organisation are facing this issue while others can see the reports.
- WilliamCrokeNew Member
Okay, so, as was mentioned in another post by v-tsaipranay, the ClipboardItem does need to be over HTTPS on a compatible browser. But from what I have found, it is indeed in the reportEmbed.min.js that comes through the Power BI SDK.
I have found that changing all my links to HTTPS (was only ever internal) has fixed this. But I would still like to try and find out what exactly changed, as it was working over HTTP for well over a year without any issues up until yesterday morning. - cace_sistemasNew Member
I was able to solve it momentarily with a configuration in Chrome:
chrome://flags/#unsafely-treat-insecure-origin-as-secure
Insecure origins treated as secure Treat given (insecure) origins as secure origins. Multiple origins can be supplied as a comma-separated list. Origins must have their protocol specified e.g. "http://example.com". For the definition of secure contexts, see https://w3c.github.io/webappsec-secure-contexts/ – Mac, Windows, Linux, ChromeOS, Android
- EacostaSV503Regular Visitor
It worked for me. I was using http without https, working locally, but the report crashed.
I just enable this config in chrome and solve my problem. I guess it will not generate error if is in production environment when using https.
- viniciusFiorimNew Member
Morning, i have the same issues, my aplication work normaly in localhost.
When i put on production i have the issues with the clipboard, i read many posts but i dont see the config someone talking about chrome.
you can share the config to make dashboard work on chrome??
- RencoDesuNew Member
It worked for me too.thank u
- WilliamCrokeNew Member
I am getting the same issue myself now, which started occurring yesterday, as if Microsoft made an update to reportEmbed.min.js
There have been zero changes to the embedded environment I created for months now, as it was working away without issue, so there is nothing on our end that would have introduced this error.
Now, we have no reports showing throughout our plant because of this.
Screen just sticks on the following with the error in the console: - adamp07New Member
Yep, we're seeing the same on embedded reports, since yesterday. No changes to config or environment
- PauloNascimentoNew Member
Yeah, this is unexpected. I have a WPF application with an embedded PBI report using WebView2 that suddenly stopped working, with the same error mentioned above. Had been working fine for months, loading a local HTML file as the webview source. If I spin up a simple webserver to serve the same HTML file over HTTPS, it works fine. Same code.
Something has changed, and it wasn't in our applications
- dartmediaFrequent Visitor
I’m currently using an embedded service and encountering an error that says ClipboardItem is not defined. This issue appears in Chrome and Edge browsers, while it seems to work fine in Safari. Could you help me understand why this is happening?
Also, I’m using HTTP, and switching to HTTPS is not an option at the moment. Is there a way to resolve this issue so that the feature works correctly over HTTP as well?
- FabioSSenaNew Member
+1 affected as well, I'm waiting for this fix this friday as microsoft posted