# /form/generate.js?id=1 not show form

**URL:** <https://forum.mautic.org/t/form-generate-js-id-1-not-show-form/23909>\
**Category:** Product Support\
**Created:** [April 27, 2022, 12:02pm UTC](https://forum.mautic.org/t/form-generate-js-id-1-not-show-form/23909 "2022-04-27T12:02:00Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![zaharovrd](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/zaharovrd/32/7799_2.png) [@zaharovrd](https://forum.mautic.org/u/zaharovrd)\
**Post date:** [April 27, 2022, 12:02pm UTC](https://forum.mautic.org/t/form-generate-js-id-1-not-show-form/23909/1 "2022-04-27T12:02:00Z")

</div>

**Your software**  
My Mautic version is: 4.2.1  
My PHP version is: 7.4  
My Database type and version is:  
Nginx

**Your problem**  
My problem is:  
i try generate form from

> <https://github.com/mautic/mautic-grav/blob/main/README.md>

but /form/generate.js?id=1 not show

These errors are showing in the log: log is clean

Steps I have tried to fix the problem:  
rebuild form cache  
clear cach

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [April 27, 2022, 1:52pm UTC](https://forum.mautic.org/t/form-generate-js-id-1-not-show-form/23909/2 "2022-04-27T13:52:24Z")

</div>

> [@zaharovrd](#):
>
> `# Mautic - Grav Plugin`

Maybe @escopecz knows the answer.

---

<div class="post-metadata">

**Author:** ![zaharovrd](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/zaharovrd/32/7799_2.png) [@zaharovrd](https://forum.mautic.org/u/zaharovrd)\
**Post date:** [April 27, 2022, 2:03pm UTC](https://forum.mautic.org/t/form-generate-js-id-1-not-show-form/23909/3 "2022-04-27T14:03:23Z")

</div>

the problem is NOT in the plagin

problem in generate.js that’s he’s not generated forms  
Example, you can test:  
[https://m.everest-dom.com/form/generate.js?id=1](https://m.everest-dom.com/form/generate.js?id=1)

you can paste this line to your site (I turned off CORS temporarily) and nothing will happen - the form will not be generated

---

<div class="post-metadata">

**Author:** ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)\
**Post date:** [April 27, 2022, 2:08pm UTC](https://forum.mautic.org/t/form-generate-js-id-1-not-show-form/23909/4 "2022-04-27T14:08:08Z")

</div>

have you checked your web server configurations ? I had some issues with nginx in the past

---

<div class="post-metadata">

**Author:** ![zaharovrd](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/zaharovrd/32/7799_2.png) [@zaharovrd](https://forum.mautic.org/u/zaharovrd)\
**Post date:** [April 27, 2022, 2:10pm UTC](https://forum.mautic.org/t/form-generate-js-id-1-not-show-form/23909/5 "2022-04-27T14:10:19Z")

</div>

i have default nginx config…

i see this bug

> <https://github.com/mautic/mautic/issues/8757>
>
> \[//\]: # ( Invisible comment: 
> IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII…I
> Before you create the issue:
> IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
> Search for similar report among other reported issues.
> Learn how to troubleshoot at https://www.mautic.org/docs/en/tips/troubleshooting.html
> Use drag&drop to attach images or other files )
> 
> \## Bug Description
> I have 2 problems that I think are related somehow. Tracking pixels and JS code load fine in the browser, but their http code is 404, same for the forms, but for these, they don’t even work when I try to embed them in a website.
> 
> curl -I https://mymauticinstall.com/mtc.js
> HTTP/2 404
> server: nginx
> content-type: application/javascript; charset=utf-8
> vary: Accept-Encoding
> set-cookie: 7bb85555927bdb8d66d3d0ee6d04ad51=ap53f7bm8auttj8o1hqqlso3aa; path=/; secure; HttpOnly
> cache-control: no-cache
> date: Mon, 04 May 2020 22:41:30 GMT
> 
> This file when loaded in a browser shows the correct content, but it also shows a 404 error, same for the JS that loads the forms. But in the case of the forms as I said, it prevents them from working completely, so nothing gets rendered.
> 
> | Q | A
> | --- | ---
> | Mautic version | 2.16.2
> | PHP version | 7.3.17-1+ubuntu18.04.1+deb.sury.org+1
> | Browser | 81.0.4044.129 (Official Build) (64-bit) 
> 
> \### Steps to reproduce
> 1. Install Mautic on Laravel Forge (Nginx)
> 2. Make use of the tracking code and embedded forms
>  
> \### Log errors
> Nginx:
> 2020/05/04 17:39:49 \[debug\] 28961#28961: \*1 http filename: “/home/forge/mymauticinstall.com/public/mtc.js”
> 2020/05/04 17:39:49 \[debug\] 28961#28961: \*1 add cleanup: 00005627D28D57B8
> 2020/05/04 17:39:49 \[error\] 28961#28961: \*1 open() “/home/forge/mymauticinstall.com/public/mtc.js” failed (2: No such file or directory), client: 179.6.209.113, server: mymauticinstall.com, request: “HEAD /mtc.js HTTP/2.0”, host: “mymauticinstall.com”
> 2020/05/04 17:39:49 \[debug\] 28961#28961: \*1 http finalize request: 404, “/mtc.js?” a:1, c:1
> 2020/05/04 17:39:49 \[debug\] 28961#28961: \*1 http special response: 404, “/mtc.js?”
> 2020/05/04 17:39:49 \[debug\] 28961#28961: \*1 internal redirect: “/index.php?”
> 
> \# Nginx config:
> \`\`\`
> add\_header 'Access-Control-Allow-Origin' "\*";
> 
> \# redirect index.php to root
> rewrite ^/index.php/(.\*) /$1 permanent;
> 
> \# Allow the filemanager to work
> location ~ ^/app/bundles/CoreBundle/Assets/js/libraries/ckeditor/filemanager/connectors/php/filemanager.php$ {
> allow all;
> fastcgi\_pass unix:/var/run/php/php7.3-fpm.sock;
> include fastcgi\_params;
> }
> 
> \# Deny everything else in /app folder except Assets folder in bundles
> location ~ /app/bundles/.\*/Assets/ {
> allow all;
> access\_log off;
> }
> location ~ /app/ { deny all; }
> 
> \# Deny everything else in /addons or /plugins folder except Assets folder in bundles
> location ~ ^/(addons|plugins)/.\*/Assets/ {
> allow all;
> access\_log off;
> }
> location ~ ^/(addons|plugins)/ { deny all; }
> 
> \# Deny all php files in themes folder
> location ~\* ^/themes/(.\*)\\.php {
> deny all;
> }
> 
> \# Deny yml, twig, markdown, init file access
> location ~\* /(.\*)\\.(?:markdown|md|twig|yaml|yml|ht|htaccess|ini)$ {
> deny all;
> access\_log off;
> log\_not\_found off;
> }
> 
> \# Deny all attempts to access hidden files/folders such as .htaccess, .htpasswd, .DS\_Store (Mac), etc...
> \# Except .well-known to allow for certbot to issue and renew certificates
> location ~ /\\.(?!well-known).\* {
> deny all;
> access\_log off;
> log\_not\_found off;
> }
> 
> \# Deny all grunt, composer files
> location ~\* (Gruntfile|package|composer)\\.(js|json)$ {
> deny all;
> access\_log off;
> log\_not\_found off;
> }
> 
> \# Deny access to any files with a .php extension in the uploads directory
> location ~\* /(?:uploads|files)/.\*\\.php$ {
> deny all;
> }
> 
> location ~ ^/mtc.js {
> default\_type "application/javascript";
> try\_files $uri $uri/ /index.php$is\_args$args;
> }
> 
> location ~\* ^/media/js/$ {
> add\_header 'Cache-Control' public;
> expires 7d;
> }
> 
> location ~ \\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt)$ {
> allow all;
> try\_files $uri $uri/ /index.php$is\_args$args;
> }
> 
> \# Set cache expiry time
> location ~\* \\.(jpg|jpeg|png|ico|css)$ {
> expires 365d;
> }
> 
> location ~\* \\.(pdf)$ {
> expires 30d;
> }
> 
> \# Add X-Robots-Tag header to login page to prevent bots from indexing or following
> add\_header X-Robots-Tag "noindex, nofollow"
> \`\`\`
> Any help is appreciated, thanks.
> 
> PS. Just want to clarify that CORS is disabled.
> 
> \[//\]: # ( Invisible comment:
> Please check for related errors in the latest log file in \[mautic root\]/app/log/ and/or the web server's logs and post them here. Be sure to remove sensitive information if applicable. )

but i don’t have 404 error

---

<div class="post-metadata">

**Author:** ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)\
**Post date:** [April 27, 2022, 2:11pm UTC](https://forum.mautic.org/t/form-generate-js-id-1-not-show-form/23909/6 "2022-04-27T14:11:44Z")

</div>

in nginx make sure you have enabled \*.js

```auto
location ~ /(mtc.js|1.js|.*\.js|mtracking.gif|.*\.gif|mtc) {

```

Many default Mautic nginx configurations are

```auto
location ~ /(mtc.js|1.js|mtracking.gif|.*\.gif|mtc) {

```

---

<div class="post-metadata">

**Author:** ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)\
**Post date:** [April 27, 2022, 2:12pm UTC](https://forum.mautic.org/t/form-generate-js-id-1-not-show-form/23909/7 "2022-04-27T14:12:23Z")

</div>

sorry last thing - are you getting any console errors ?

---

<div class="post-metadata">

**Author:** ![zaharovrd](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/zaharovrd/32/7799_2.png) [@zaharovrd](https://forum.mautic.org/u/zaharovrd)\
**Post date:** [April 28, 2022, 10:00am UTC](https://forum.mautic.org/t/form-generate-js-id-1-not-show-form/23909/8 "2022-04-28T10:00:43Z")

</div>

I don’t have such lines at all  
What should be in brackets below?

---

<div class="post-metadata">

**Author:** ![zaharovrd](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/zaharovrd/32/7799_2.png) [@zaharovrd](https://forum.mautic.org/u/zaharovrd)\
**Post date:** [April 28, 2022, 10:14am UTC](https://forum.mautic.org/t/form-generate-js-id-1-not-show-form/23909/9 "2022-04-28T10:14:48Z")

</div>

only

> [2022-04-28 10:13:52] mautic.NOTICE: PHP Notice - Trying to access array offset on value of type bool - in file /home/master/m.everest-dom.com/plugins/MauticFocusBundle/Include/lessc.inc.php - at line 719 {“args”:,“orderedValues”:,“keywordValues”:,“assignedValues”:,“i”:0,“last”:false}

---

<div class="post-metadata">

**Author:** ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)\
**Post date:** [April 28, 2022, 10:55am UTC](https://forum.mautic.org/t/form-generate-js-id-1-not-show-form/23909/10 "2022-04-28T10:55:56Z")

</div>

these are your log files, if you are on chrome you can right click and “inspect” and then choose “console” to see if there are any other errors there.

To get a full explanation of nginx and setting up Mautic check out [here](https://www.linuxbabe.com/ubuntu/install-mautic-self-hosted-email-marketing-ubuntu-20-04). He has a full nginx conf file there that you can use, however you need to make the changes to it that I recommended above.

---

<div class="post-metadata">

**Author:** ![zaharovrd](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/zaharovrd/32/7799_2.png) [@zaharovrd](https://forum.mautic.org/u/zaharovrd)\
**Post date:** [April 28, 2022, 11:16am UTC](https://forum.mautic.org/t/form-generate-js-id-1-not-show-form/23909/11 "2022-04-28T11:16:27Z")

</div>

it was the first thing I looked at. It’s clean…

 ![screen14](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/d/d15bcd34a64b424a89d57846d0ecf84d81d63a20.jpeg)

interesting that focus working perfectly

 ![screen13](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/e/e254b98552692f20b5a8839ea8694b9c514a9eab.jpeg)

---

<div class="post-metadata">

**Author:** ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)\
**Post date:** [May 1, 2022, 9:58am UTC](https://forum.mautic.org/t/form-generate-js-id-1-not-show-form/23909/12 "2022-05-01T09:58:15Z")

</div>

voodoo magic. Glad it is all working now

---

<div class="post-metadata">

**Author:** ![zaharovrd](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/zaharovrd/32/7799_2.png) [@zaharovrd](https://forum.mautic.org/u/zaharovrd)\
**Post date:** [May 1, 2022, 7:36pm UTC](https://forum.mautic.org/t/form-generate-js-id-1-not-show-form/23909/13 "2022-05-01T19:36:32Z")

</div>

No, not working (  
Forms not showing

---

<div class="post-metadata">

**Author:** ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)\
**Post date:** [May 2, 2022, 6:41am UTC](https://forum.mautic.org/t/form-generate-js-id-1-not-show-form/23909/14 "2022-05-02T06:41:01Z")

</div>

maybe try and change your base url to [Mautic](http://m.everest-dom.com/index.php) and see if that works

---

<div class="post-metadata">

**Author:** ![zaharovrd](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/zaharovrd/32/7799_2.png) [@zaharovrd](https://forum.mautic.org/u/zaharovrd)\
**Post date:** [May 8, 2022, 8:17am UTC](https://forum.mautic.org/t/form-generate-js-id-1-not-show-form/23909/15 "2022-05-08T08:17:37Z")

</div>

Does it work for you? Can I see somewhere how it is implemented?

I changed the nginx config…  
F12 in Firefox - no errors

inserting a form through js code does not work.

You can try it:  
`<script type="text/javascript" src="//m.mautibox.ru/form/generate.js?id=3"></script>`

---

<div class="post-metadata">

**Author:** ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)\
**Post date:** [May 8, 2022, 8:32am UTC](https://forum.mautic.org/t/form-generate-js-id-1-not-show-form/23909/16 "2022-05-08T08:32:58Z")

</div>

can you try two things:

1. in your src, add in https: src=“[https://m.mautibox.ru/form/generate.js?id=3](https://m.mautibox.ru/form/generate.js?id=3)”  
and if that still does not work, try and adding in index.php as well: src=“[https://m.mautibox.ru/index.php/form/generate.js?id=3](https://m.mautibox.ru/index.php/form/generate.js?id=3)”

---

<div class="post-metadata">

**Author:** ![zaharovrd](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/zaharovrd/32/7799_2.png) [@zaharovrd](https://forum.mautic.org/u/zaharovrd)\
**Post date:** [May 8, 2022, 8:54am UTC](https://forum.mautic.org/t/form-generate-js-id-1-not-show-form/23909/17 "2022-05-08T08:54:13Z")

</div>

I tried it right away, I thought it might not work out the way. Did not help.  
But the interesting thing is that the focus works great

 ![screen23](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/2/2aadd330daff219ed4587cc6de1f50dd17e76237.jpeg)  
it’s a gravcms

if focus work fine, but forms not working - i think that problem in generate.js

---

<div class="post-metadata">

**Author:** ![zaharovrd](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/zaharovrd/32/7799_2.png) [@zaharovrd](https://forum.mautic.org/u/zaharovrd)\
**Post date:** [May 8, 2022, 9:10am UTC](https://forum.mautic.org/t/form-generate-js-id-1-not-show-form/23909/18 "2022-05-08T09:10:48Z")

</div>

Ha-ha-ha 😀  
Earned!  
the problem was in

 ![изображение](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/5/53a93ae72e114cecdd1da2cbb4392933f3379c8e.png)

i removed js from hear and all Earned

---

<div class="post-metadata">

**Author:** ![robm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/robm/32/260_2.png) [@robm](https://forum.mautic.org/u/robm)\
**Post date:** [September 6, 2022, 9:43am UTC](https://forum.mautic.org/t/form-generate-js-id-1-not-show-form/23909/19 "2022-09-06T09:43:50Z")

</div>

@mikew - adding the /index.php/ to the js for a form did the trick.

The bigger question though is how do I set up my Mautic so I don’t need to manually add in /index.php/ to each js script to get a mautic form to render?

---

<div class="post-metadata">

**Author:** ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)\
**Post date:** [September 6, 2022, 10:10am UTC](https://forum.mautic.org/t/form-generate-js-id-1-not-show-form/23909/20 "2022-09-06T10:10:52Z")

</div>

Hey Rob,

It is an nginx conf file misconfiguration, I fixed this on your server - so please check and let me know if working now.

> [@mikew](#):
>
> in nginx make sure you have enabled \*.js
> 
> ```auto
> location ~ /(mtc.js|1.js|.*\.js|mtracking.gif|.*\.gif|mtc) {
> 
> ```
> 
> Many default Mautic nginx configurations are
> 
> ```auto
> location ~ /(mtc.js|1.js|mtracking.gif|.*\.gif|mtc) {
> 
> ```

[Next page](https://forum.mautic.org/t/form-generate-js-id-1-not-show-form/23909.md?page=2)
