Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

Uncaugh DOMException: Failed to execute 'postMessage' on Window



Pega Platform 7.1.8 is upgraded to Pega Platform 8.3.1.

Error occurs when using Pega 8.3.1 Mashup to embed Pega applications to a custom portal. The Getgadgetdata Pega Mashup API is used while closing a tab.

For more information, refer to: (

Error Messages

Uncaught DOMException: Failed to execute 'postMessage' on 'Window': Invalid target origin '//IAC' in a call to 'postMessage'.
    at Object.D [as send] (*/!STANDARD?host=bpmdev8&pzuiactionzzz=CXtpbn1GUXVIQmxCNndHdkVKVGlaa3dFVjU2czJOdi96RjlpeFV3WU0zcTVIOTRvSE1EQ05nRWovMUhMcVdsejJ3SVhy*:71:798)
    at J (*/!STANDARD?host=bpmdev8&pzuiactionzzz=CXtpbn1GUXVIQmxCNndHdkVKVGlaa3dFVjU2czJOdi96RjlpeFV3WU0zcTVIOTRvSE1EQ05nRWovMUhMcVdsejJ3SVhy*:71:1517)
    at Object.H [as send] (*/!STANDARD?host=bpmdev8&pzuiactionzzz=CXtpbn1GUXVIQmxCNndHdkVKVGlaa3dFVjU2czJOdi96RjlpeFV3WU0zcTVIOTRvSE1EQ05nRWovMUhMcVdsejJ3SVhy*:71:2846)
    at pega.web.gadget._postActionToGadget (*/!STANDARD?host=bpmdev8&pzuiactionzzz=CXtpbn1GUXVIQmxCNndHdkVKVGlaa3dFVjU2czJOdi96RjlpeFV3WU0zcTVIOTRvSE1EQ05nRWovMUhMcVdsejJ3SVhy*:68:20378)
    at pega.web.gadget._doApiAction (*/!STANDARD?host=bpmdev8&pzuiactionzzz=CXtpbn1GUXVIQmxCNndHdkVKVGlaa3dFVjU2czJOdi96RjlpeFV3WU0zcTVIOTRvSE1EQ05nRWovMUhMcVdsejJ3SVhy*:68:20871)
    at pega.web.apiSingleton.doAction (*/!STANDARD?host=bpmdev8&pzuiactionzzz=CXtpbn1GUXVIQmxCNndHdkVKVGlaa3dFVjU2czJOdi96RjlpeFV3WU0zcTVIOTRvSE1EQ05nRWovMUhMcVdsejJ3SVhy*:68:3564)
    at eval (eval at mtek.bpm.unloader.releaseLock (, <anonymous>:1:14)
    at Object.mtek.bpm.unloader.releaseLock (
    at J.<anonymous> (
    at (

Steps to Reproduce

  1. Include the Mashup code used in a JSP file as below:

    <script src ='/prweb/IAC/?host=<%=host%>&pyActivity=pzIncludeMashupScripts'></script>
    <div id="IACGadget"
    data-pega-gadgetname ='IACGadget' 
    data-pega-action ='OpenWorkByURL' 
    data-pega-action-param-query='[email protected]'
    data-pega-action-param-model ='' 
    data-pega-action-param-readonly ='false'
    data-pega-isdeferloaded ='false' 
    data-pega-applicationname ='MTKBPMApp' 
    data-pega-threadname ='<%=threadId%>' 
    data-pega-resizetype ='stretch' 
    data-pega-url ='/prweb/IAC/' 
    data-pega-action-param-parameters ="{'pzSkinName':'MTEKApplicationSkin','pyMashupSkeletonName':'pyDefaultMashupSkeleton'"></div>

  2. Reference a custom JavaScript file in the JSP file.
  3. Use the code as below to obtain the Gadget data in the JavaScript file:

    pega.web.api.doAction("IACGadget", "getGadgetData", "[pyWorkPage.pzInsKey]")

Root Cause

For DOMException, in the Mashup snippet, the 'data-pega-url' attribute is specified as '/prweb/IAC/', which resulted in the error.

For more information, refer to:

Square brackets must be included if Data Binding (as below) is used.

pega.web.api.doAction("myGadget", "getGadgetData", "[gadget/myGadget/.pxCreateOpName]")

This must be referred as pega.web.api.doAction("myGadget", "getGadgetData", "[.pxCreateOpName]")

Data Binding syntax:






Here’s the explanation for the reported behavior:

For DOMException, in the Mashup snippet, specify the complete URL (including the domain name) for the 'data-pega-url' attribute.

Use the below syntax when the doAction(getGadgetData) is undefined:

Pega.web.api.doAction(:IACGadget”,”getGadgetData”,”pyWorkPage.pzInsKey”,{callback:function(){debugger;alert(‘calling back…’); debugger;}})

Published August 6, 2020 - Updated December 2, 2021

Was this useful?

0% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us