Uncaught Referenceerror: Tygh Is Not Defined At Index.php?dispatch=Profiles.update

After upgrading to 4.10.4 SP1 I got the error below:

index.php?dispatch=profiles.update&selected_section=general:360 Uncaught ReferenceError: Tygh is not defined
    at index.php?dispatch=profiles.update&selected_section=general:360

And I attached detailed error line.

I couldn't find the reason of the issue.

PS: I use Vivashop theme updated latest version viva_v2.29.

screenshot.JPG

Suggest manually clearing your cache by either removing or renaming var/cache directory.

I did it. But not solved. May it be a bug?
It's said that "Tygh is not defined". I checked Tygh folder, it is there where it is expected to be.

I reuploaded JS folder of latest 4.10.4 version and deleted cache again. But, the error hasn't gone.

Is this issue about TPL or PHP?

I switched PHP to 7.1 and 7.2 and deleted cache manually, but the problem is same. It didn't work.

Hello

This part code should be on the bottom page.

On your screen know that it is high in the code of the page. You don't have any modifications to the code?

Best regards

Robert

Hello

This part code should be on the bottom page.

On your screen know that it is high in the code of the page. You don't have any modifications to the code?

Best regards

Robert

No, I didn't do any modification on this script.

The script of "Country - City selection" doesn't work on frontpage but it works at admin side without any problem. This situation indicates that the problem is not about the server. If it was about the server, the script shouldn't be running at administrator side. But it works.

BTW, I contacted to admin of server. They said that when they enable and check all extensions, the problem still occurs, same. But when they try to get "try catch" for testing purposes and provide control, there is no an error.

I think problem is not about extension on the server.

I realized that
script src="https://code.jquery.com/jquery-3.3.1.min.js"(Line 1341)
is being loaded before TYGH is defined. But the script, which tries loading states and countries, is being loaded before the jQuery loaded. (At the line 557) That's why TYGH can not be loaded properly. It fails.
But jQuery is being loaded. I don't understand why the script part appears before jQuery loaded.
Fortunately, I have found the solution. I opened /public_html/design/themes/vivashop/templates/index.tpl
{include file="common/scripts.tpl"} <-- this line was at 112
I cut and put it above.
When I put this line {include file="common/scripts.tpl"} below the
{if "DEVELOPMENT"|defined && $smarty.const.DEVELOPMENT == true}
jQuery isn't being loaded. But when I put {include file="common/scripts.tpl"} above the DEVELOPMENT line, jQuery is being loaded properly and works fine.
I think I fixed it but I am not sure whether this changes can cause some different problems. I hope CS-Cart developers could examine this issue.
If you are using any script file and getting "Uncaught ReferenceError:" which means 'x' is either a variable or a method which you are trying to use before declaring it using var keyword. This means that there is a non-existent variable referenced somewhere. This variable needs to be declared, or you need to make sure it is available in your current script or scope otherwise , it will endup throwing this 'x' is not defined error . This usually indicates that your library is not loaded and JavaScript does not recognize the 'x'.
To solve this error: Load your library at the beginning of all your scripts.
There can be multiple other reasons for this issue:
  • Path to CDN library you included is not correct
  • The library file is corrupted
  • Working offline
  • Conflict with Other Libraries

I realized that
is being loaded before TYGH is defined. But the script, which tries loading states and countries, is being loaded before the jQuery loaded. (At the line 557) That's why TYGH can not be loaded properly. It fails.
But jQuery is being loaded. I don't understand why the script part appears before jQuery loaded.
Fortunately, I have found the solution. I opened /public_html/design/themes/vivashop/templates/index.tpl
{include file="common/scripts.tpl"} <-- this line was at 112
I cut and put it above.
When I put this line {include file="common/scripts.tpl"} below the
{if "DEVELOPMENT"|defined && $smarty.const.DEVELOPMENT == true}
jQuery isn't being loaded. But when I put {include file="common/scripts.tpl"} above the DEVELOPMENT line, jQuery is being loaded properly and works fine.
I think I fixed it but I am not sure whether this changes can cause some different problems. I hope CS-Cart developers could examine this issue.

bu çözüm işe yaradı mı?

bu adresten ayrıntı bir şekilde anlattım. ilgilenirseniz çok sevinirim.

http://forum.cs-cart-destek.com/konu-zoho-salesiq-kullanmasi-sonrasi-sayfaya-komple-script-error-basmasi.html