Marketo Lightbox Form on a Gatsby Project - Failed to execute 'postMessage' on 'DOMWindow' This project is a GatsbyJS Project. I have a button component that takes in the id of the marketo form, and the button text that when the button is clicked, it opens up a light box that holds a Marketo form. The form renders just fine. However, after filling out a form and hitting submit, this error shows:
forms2.min.js:4 Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://...') does not match the recipient window's origin ('https://...').
Here is the button component (sans the styles section):
import React, { useState ,useEffect, useRef } from 'react';
import styled from 'styled-components';
import media from '../../styles/media';
const CustomTrialButton = (props) => {
const formRef = useRef(null);
useEffect(() => {
LoadForm(props.id);
},[props.id]);
const LoadForm =(id) => {
setTimeout(() => {
if(typeof MktoForms2 !== 'undefined'){
MktoForms2.loadForm(
"https://338-HTA-134.mktoweb.com",