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
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.
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
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:
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
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.