Forum Discussion
CORS issue postMessage target origin does not match
Sorry, that was the only idea I had.
I'm not familiar with the hostdata parameter. I have not seen it used before with PBIRS and can't see any documentation on it. But it does not look like any of the information you are passing there would influence CORS in any way.
Are you able to see the call stack of that exception using the chrome dev tools? That my give you a hint as to whether it's your app or the report triggering this.
I got the hostdata parameter from one of the examples on the web. I don't know if it does anything but the example used it so I left it in.
If I change 4015 in the url of the report server to 4010 and use fidler to redirect to 4015 then the error does not occur. This suggests to me it is the report server. The error itself would support that, indicating that postMessage was invoked by code delivered from 4015 for a recipient at 4010
Thanks for the suggestions.
For anyone else reading this - the 'solution' I found is to use fiddler and add a rule to redirect
I changed the port of the url for the powerbi report in my we app from 4015 (the powerbi port) to 4010 (my apps port) and added a rule in fiddler to intercept that and change the port to 4015. This 'spoofs' the report server and so the error does not occur.
Maybe not the 'real' solution, but it works.