# Uncaught ReferenceError: Mautic is not defined

**URL:** <https://forum.mautic.org/t/uncaught-referenceerror-mautic-is-not-defined/25919>\
**Category:** Product Support\
**Created:** [November 2, 2022, 4:33am UTC](https://forum.mautic.org/t/uncaught-referenceerror-mautic-is-not-defined/25919 "2022-11-02T04:33:48Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![shyamalm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/shyamalm/32/1394_2.png) [@shyamalm](https://forum.mautic.org/u/shyamalm)\
**Post date:** [November 2, 2022, 4:33am UTC](https://forum.mautic.org/t/uncaught-referenceerror-mautic-is-not-defined/25919/1 "2022-11-02T04:33:48Z")

</div>

**Your software**  
My Mautic version is: v4.4.1  
My PHP version is: 7.4.23  
My Database type and version is: 10.3.34-MariaDB-0ubuntu0.20.04.1

**Your problem**  
My problem is:  
I am using mautic Lead form in my own website and it is working fine and lead is also capture properly.  
but problem is the page where lead form is integrated when I inspect that page I am getting below error , no idea from where this is coming and how to resolve this.

Uncaught ReferenceError: Mautic is not defined  
at parcelRequire.RfSX…/asset.service (builder.js:156:1)  
at f (builder.js?v4e51210b:1:468)  
at parcelRequire.iHk9 (builder.js?v4e51210b:1:771)  
at builder.js?v4e51210b:1:1023

File Path : mautic/plugins/GrapesJsBuilderBundle/Assets/library/js/dist/builder.js

Mautic.launchBuilder = launchBuilderGrapesjs;  
Mautic.initSelectTheme = initSelectThemeGrapesjs(Mautic.initSelectTheme);  
Mautic.setThemeHtml = setThemeHtml;

Please guide us. Awaiting for your response.

---

<div class="post-metadata">

**Author:** ![adiux](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/adiux/32/5793_2.png) [@adiux](https://forum.mautic.org/u/adiux)\
**Post date:** [November 2, 2022, 8:14am UTC](https://forum.mautic.org/t/uncaught-referenceerror-mautic-is-not-defined/25919/2 "2022-11-02T08:14:30Z")

</div>

This looks like Grapesjs (the email builder) is loaded - but it should not.

Are you using it on a Mautic landingpage or are you integrating it into your own website?

---

<div class="post-metadata">

**Author:** ![shyamalm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/shyamalm/32/1394_2.png) [@shyamalm](https://forum.mautic.org/u/shyamalm)\
**Post date:** [November 2, 2022, 9:27am UTC](https://forum.mautic.org/t/uncaught-referenceerror-mautic-is-not-defined/25919/3 "2022-11-02T09:27:56Z")

</div>

I am using mautic lead form on my own website. Thanks

---

<div class="post-metadata">

**Author:** ![shyamalm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/shyamalm/32/1394_2.png) [@shyamalm](https://forum.mautic.org/u/shyamalm)\
**Post date:** [November 3, 2022, 3:33am UTC](https://forum.mautic.org/t/uncaught-referenceerror-mautic-is-not-defined/25919/4 "2022-11-03T03:33:52Z")

</div>

We are integrated mautic lead form into our own website,  
Please suggest some solution so that we can apply it at our end.  
Awaiting for your response.

---

<div class="post-metadata">

**Author:** ![adiux](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/adiux/32/5793_2.png) [@adiux](https://forum.mautic.org/u/adiux)\
**Post date:** [November 3, 2022, 9:02am UTC](https://forum.mautic.org/t/uncaught-referenceerror-mautic-is-not-defined/25919/5 "2022-11-03T09:02:27Z")

</div>

@shyamalm how did you integrate it? Are you using a CMS?

---

<div class="post-metadata">

**Author:** ![shyamalm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/shyamalm/32/1394_2.png) [@shyamalm](https://forum.mautic.org/u/shyamalm)\
**Post date:** [November 3, 2022, 9:39am UTC](https://forum.mautic.org/t/uncaught-referenceerror-mautic-is-not-defined/25919/6 "2022-11-03T09:39:39Z")

</div>

Mautic inbulid Iframe code integrated in our website.

---

<div class="post-metadata">

**Author:** ![adiux](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/adiux/32/5793_2.png) [@adiux](https://forum.mautic.org/u/adiux)\
**Post date:** [November 9, 2022, 9:10am UTC](https://forum.mautic.org/t/uncaught-referenceerror-mautic-is-not-defined/25919/7 "2022-11-09T09:10:47Z")

</div>

Is it an option to try via the JavaScript (recommended)?

```nohighlight
<script type="text/javascript" src="https://YOURMAUTIC/form/generate.js?id=1"></script>

```

I think your issue is related to this:

> <https://github.com/mautic/mautic/issues/10496>
>
> \### Mautic Version
> 
> 4.0.0
> 
> \### PHP version
> 
> 4.1
> 
> \### What browsers are you seein…g the problem on?
> 
> Not relevant
> 
> \### What happened?
> 
> \`Mautic is not defined\` will show on javascript console when using preference center and grapejs 
> 
> 
> !\[image\](https://user-images.githubusercontent.com/12627658/135575134-b0ccc0fc-a769-4bff-8df9-4cfe8aca5843.png)
> 
> 
> \### How can we reproduce this issue?
> 
> \- Activate GrapeJS plugin
> \- Activate the Preference center
> \- Try to unsubscribe using the preference center
> \- GrapeJS assets (cs & js) will be loaded although they are not require
> \- \`Mautic is not defined\` will show on javascript console
> 
> \### Relevant log output
> 
> \_No response\_
> 
> \### Code of Conduct
> 
> \- \[X\] I confirm that I have read and agree to follow this project's Code of Conduct
> 
> \<bountysource-plugin\>
> 
> \---
> Want to back this issue? \*\*\[Post a bounty on it!\](https://app.bountysource.com/issues/108498987-grapejs-plugin-inject-assets-to-preference-center?utm\_campaign=plugin&utm\_content=tracker%2F5355074&utm\_medium=issues&utm\_source=github)\*\* We accept bounties via \[Bountysource\](https://app.bountysource.com/?utm\_campaign=plugin&utm\_content=tracker%2F5355074&utm\_medium=issues&utm\_source=github).
> \</bountysource-plugin\>
