0

im struggling with Magento 2.2.4, its giving so many errors.

Initially we had Apache web server with PHP 7.1 and NO nginx. In this scenario sometimes the color and size dropdown were not getting populated but when we refresh the page it loads the dropdown. So I searched for the solution and people recommended to have Apache + NGINX + PHP FPM.

So we installed NGINX and PHP FPM. But now there is a completely new problem. The images are not loading, the size and color dropdown also not loading. Even after refreshing the web page the situation remains the same. Its happening for every product.

Seriously speaking im tired of resolving issues with Magento 2.2.4, is this version not stable?

and im getting this error message in console

jquery-migrate.min.js:6 JQMIGRATE: Logging is active blue-and-gold-lehenga-for-little-girls-party-wear.html:14 Uncaught SyntaxError: Unexpected token , in JSON at position 3804 at JSON.parse () at getNodeData (scripts.min.js:5) at Array.map () at scripts.min.js:6 at HTMLDocument.apply (main.min.js:5) at fire (jquery.min.js:212) at Object.add [as done] (jquery.min.js:215) at jQuery.fn.init.jQuery.fn.ready (jquery.min.js:223) at jQuery.fn.init (jquery.min.js:200) at new jQuery.fn.init (jquery-migrate.min.js:27)

Pls check the screen shot.error screen shot

  • you only need one webserver, apache OR nginx. you have to deceide. DO NOT use 2! there will be conflicts – Philipp Sander Jan 28 at 15:22
0

Yes the Magento 2.2.4 is a stable release. Checking the console some javascript errots are promted. You added some custom javascript in the product template. Check line 577, no reference is defined.

var enddate = new Date(jQuery('#'+id).val());

Check also the showCaption of the screenshot. If you want to declare an empty value you should use "" or ''.

enter image description here

This problems are not related to the use of nginx or apache. Actually,pointing two webservers to listen to the same port/domain is not possible until some conditions are met. Read more here: https://serverfault.com/questions/313168/is-it-possible-to-run-two-webservers-on-the-same-port-on-the-same-server-e-g

Please, before deploying Magento software, make sure to read carefully the docs and the best practice on how to customize it including javascript or other custom files. Here are some references that can help you troubleshooting your current problems:

https://devdocs.magento.com/guides/v2.2/install-gde/prereq/nginx.html

https://devdocs.magento.com/guides/v2.2/javascript-dev-guide/javascript/custom_js.html

  • Dear Arjus, thank you for such a quick response. But I didnt change anything in the code. It was working well with Apache but we had issues sometimes the Size dropdown was not loading and when refresh the size and color dropdowns were loading properly, and it was happening 50% of the times so we searched internet and somebody recommended to install nginx and it will make your website faster and these issues will be resolved as well. And when we installed nginx with Apache then we got this issue and even if we disable nginx and jsut kept the Apache only even then this issue exists. – Ans Jan 28 at 15:55
  • Hi @Ans I understand. I suggest you following this steps: 1 - replicate the apache configuration. 2 - check the apache logs for particular error messages. If found, search and solve them, if not continue to the other step. 3 - open console and check for Javascript errors. If found start searching the errors, if not deploy everything and flush the cache. Hope this helps. – arjus Jan 28 at 16:15
  • this is the lnk to the website and you can see the error, we didnt make any change in code. [colorcherry.com/girls/girls-clothing/… . Can you pls help identifying this, it was working how come sudden issue related to code. – Ans Jan 28 at 16:26
  • @Ans as you can see from the console a couple of Javascript errors are prompted. The first error has to do with an undefined object. The second one with a syntax error. Start from here if you want. Try to solve this problems then continue the troubleshooting. For as long as I see this errors I can't relate your problems to server side issues. – arjus Jan 28 at 16:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.