Open mhouttemane opened 2 years ago
Hi!
I am having the exact same problem. The exception is thrown 5 times on every page load.
auraprod.js:88 Uncaught (in promise) DOMException: Failed to execute 'postMessage' on 'Window': #-upw5gdD4giTZpg/aura_prod.js:88:92459) at WindowPostMessageProxy.sendResponse (https://campbellsfoodservice--boylanm.lightning.force.com/resource/1637179820000/powerbijs:6070:23) at eval (https://campbellsfoodservice--boylanm.lightning.force.com/resource/1637179820000/powerbijs:6138:32)
Im also having the same issue with LWC, Aura seems to work ok.
Im also having the same issue with LWC, Aura seems to work ok.
I've also the same issue in Aura... For me LWC and Aura don't work.
Does anyone have any new information on this issue?
Has there been any news on this? Has anyone found a solution?
No In the end I went with Aura as the error didn't seem to occur.
No In the end I went with Aura as the error didn't seem to occur.
Hello,
Can you please show me how you did it ? I have the same error with Aura as well.
Thank you !
Hello,
found some information online that might have helped. It seems it is failing in the static resource file powerbijs.js at line 6067. I have added a workaround code at this property assignment:
WindowPostMessageProxy.prototype.sendResponse = function (targetWindow, message, trackingProperties) {
this.addTrackingProperties(message, trackingProperties);
if (this.logMessages) {
console.log(this.name + " Sending response:");
console.log(JSON.stringify(message, null, ' '));
}
// Fix starts here:
var windowMessage = '' + message;
// Replace below line:
// targetWindow.postMessage(message, "*");
targetWindow.postMessage(windowMessage, "*");
};
did a quick test, and did not see any side effects, so I am assuming it works. Not a JS expert, so if there are any JS experts out there that can explain why this fixed the issue, that would be great.
Thanks!
Hello,
found some information online that might have helped. It seems it is failing in the static resource file powerbijs.js at line 6067. I have added a workaround code at this property assignment:
WindowPostMessageProxy.prototype.sendResponse = function (targetWindow, message, trackingProperties) { this.addTrackingProperties(message, trackingProperties); if (this.logMessages) { console.log(this.name + " Sending response:"); console.log(JSON.stringify(message, null, ' ')); } // Fix starts here: var windowMessage = '' + message; // Replace below line: // targetWindow.postMessage(message, "*"); targetWindow.postMessage(windowMessage, "*"); };
did a quick test, and did not see any side effects, so I am assuming it works. Not a JS expert, so if there are any JS experts out there that can explain why this fixed the issue, that would be great.
Thanks!
Hello ! I can confirm this is working.
Thank you !
This appears to fix the issue for me too. I was getting 5 popup error messages as described by other users
Hi !
I'm trying to embed power Bi reports in my salesforce organization through LWC and Aura component (same problems with the 2). I follow this explanations : https://github.com/PowerBiDevCamp/SalesforceAppOwnsDataEmbedding
However, I get an error on each time, I load the page.User-added imageIn javascript, screenshot of the message is attached.
auraproddebug.js:28891 Uncaught (in promise) DOMException: Failed to execute 'postMessage' on 'Window': #-upw5gdD4giTZpg/aura_proddebug.js:28891:46) at WindowPostMessageProxy.sendResponse (https://myOrg.lightning.force.com/resource/1642763618000/powerbijs:6067:23) at eval (https://myOrg.lightning.force.com/resource/1642763618000/powerbijs:6135:32)
It seems that something went wrong between aura framework and powerbi javascript.
Here is the code :
powerBiReport.html : `
powerBiReport.js
import { LightningElement, api, wire, track } from 'lwc'; import getEmbeddingDataForReport from '@salesforce/apex/PowerBiEmbedManager.getEmbeddingDataForReport'; import powerbijs from '@salesforce/resourceUrl/powerbijs'; import { loadScript, loadStyle } from 'lightning/platformResourceLoader';export default class PowerBiReport extends LightningElement {
@api WorkspaceId =''; @api ReportId =''; @track reportBI; count = 0;
@wire(getEmbeddingDataForReport,{ WorkspaceId: "$WorkspaceId", ReportId: "$ReportId" }) report;
}`
PowerBiEmbedManager.cls `public with sharing class PowerBiEmbedManager {
}
}`
From the example, I just add two lines in PowerBiEmbedManager : reqGetEmbedToken.setHeader('Content-Type', 'application/json'); reqGetEmbedToken.setBody('{"accessLevel": "View", "identities" : [{"username": "oneuser@myorg.fr", "roles":["All"], "datasets": ["cec11a11-1c1f-111b-b11b-11aac11111bd"]}]}');
Can you please help me or give me some advices ?
Thank you Maxime