Your software Mautic 4 My PHP version is : 7.4 My MySQL/MariaDB version is (delete as applicable): MySQL/MariaDB version: 8.0
These errors are showing in the Mautic log : none found
Your problem My problem is : Javascript error on a different domain name other than where Mautic is installed on.
Steps I have tried to fix the problem : The error did show about CORS so I took this disabled CORS, Add domain name in the CORS setting. This error went away however the other two error still remains and I canât find or figure what causing this error
VM441:1 Uncaught SyntaxError: Unexpected token } in JSON at position 12
at JSON.parse ()
at Object.Core.parseToObject (mautic-form.js?v1ced89cf:47)
at mautic-form.js?v1ced89cf:48
at mautic-form.js?v1ced89cf:49
And the second error:
Uncaught TypeError: Cannot read properties of undefined (reading âbtgsubscriptionformâ)
at Object.Form.prepareValidation (mautic-form.js?v1ced89cf:8)
at Object.Form.prepareForms (mautic-form.js?v1ced89cf:6)
at Object.Core.onLoad (mautic-form.js?v1ced89cf:47)
at HTMLScriptElement.script.onload (:1:491)
Form.prepareValidation @ mautic-form.js?v1ced89cf:8
Form.prepareForms @ mautic-form.js?v1ced89cf:6
Core.onLoad @ mautic-form.js?v1ced89cf:47
script.onload @ VM434:1
load (async)
(anonymous) @ VM434:1
(anonymous) @ generate.js?id=1:11
I have same problem,
Mautic4 & PHP7.4
Mautic3.3.4 & PHP7.4
have 2 errors,
first ==> Uncaught SyntaxError: Unexpected token } in JSON at position 12
@ return JSON.parse(â{"â + decodeURI(params.trim().replace(/&/g, ââ,"").replace(/=/g, ââ:"")) + â"}â);
second ==> Uncaught TypeError: Cannot read properties of undefined (reading âtestformsâ)
@ if (typeof window.MauticFormValidations[formId] == âundefinedâ) {
Uncaught SyntaxError: Unexpected token } in JSON at position 12
at JSON.parse ()
at Object.Core.parseToObject (mautic-form.js?v1ced89cf:47)
at mautic-form.js?v1ced89cf:48
at mautic-form.js?v1ced89cf:49
mautic-form.js?v1ced89cf:8 Uncaught TypeError: Cannot read properties of undefined (reading âbtgsubscriptionformâ)
at Object.Form.prepareValidation (mautic-form.js?v1ced89cf:8)
at Object.Form.prepareForms (mautic-form.js?v1ced89cf:6)
at Object.Core.onLoad (mautic-form.js?v1ced89cf:47)
at HTMLScriptElement.script.onload (:1:491)
mautic-form.js?v1ced89cf:17 Uncaught ReferenceError: MauticFormValidations is not defined
at Object.validateForm (mautic-form.js?v1ced89cf:17)
at Object.Core.validateForm (mautic-form.js?v1ced89cf:39)
at HTMLFormElement.theForm.onsubmit (mautic-form.js?v1ced89cf:6)
Did you just insert the form via JavaScript?
Did you set any validation parameters in the form?
Do you use any firewall, like Wordfence?