Property 'MktoForms2' does not exist on type 'Window & typeof globalThis'

Getting error:(Property 'MktoForms2' does not exist on type 'Window & typeof globalThis') on using react with typescript

useEffect(() => { window.MktoForms2.loadForm("//app-sj11.marketo.com", "XXX-XXX-XXX", 1608);
}, []);

1 Answer

You are likely to get that error if the actual MktoForms2 library hasn't been loaded yet. That should be loaded like this, before you try and make the loadForm call..

<script src="//"></script>

The domain that the script gets loaded from is specific to your Marketo instance, but you can find the documentation for the form library here:

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

You Might Also Like