Failed to execute PostMessage on DOMWindow using apps script

為{幸葍}努か 提交于 2021-01-28 20:48:45

问题


I am getting the following error message occasionally when I open my web-app with apps script.

Need to clarify two questions

  • What is this error?
  • How do I fix it?

I need this website to run consistently obviously so I am willing to start a bounty in a few days if the solution is not obvious. I make many calls to google.script.run functions.

Failed to execute 'postMessage' on 'DOMWindow': 
The target origin provided 
('https://n-j3xfpwqmogabbvlhsvezfcvbljow7bq45m6qoky-0lu-script.googleusercontent.com') 
does not match the recipient window's origin ('null').

Edit: I should probably mention that my app contains jquery, but when I remove the script and Css tags below there is no overall effect. It just simply is not loading sometimes for no apparent reason.

 <script   src="https://code.jquery.com/jquery-3.1.0.js"   integrity="sha256-slogkvB1K3VOkzAI8QITxV3VzpOnkeNVsKvtkYLMjfk="   crossorigin="anonymous"></script>
  <script   src="https://code.jquery.com/ui/1.12.0/jquery-ui.js"   integrity="sha256-0YPKAwZP7Mp3ALMRVB2i8GXeEndvCq3eSl/WsAl1Ryk="   crossorigin="anonymous"></script>
  <link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/css/select2.min.css" rel="stylesheet" />
  <script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/js/select2.min.js"></script>

回答1:


Based from the error Failed to execute postMessage on DOMWindow you might not properly configured your credentials from Google API console or you are trying to run your script from the file system instead of web server even running on localhost

Just make sure that posting message is loaded. Most of the time this error occurred when sending messages failed to load.

Try to check workaround suggested by community here: SOTicket1 or SOTicket2.



来源:https://stackoverflow.com/questions/38999718/failed-to-execute-postmessage-on-domwindow-using-apps-script

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!