4

https://i.stack.imgur.com/Q05dv.jpg

  1. I have Magento2 site. When I load first time in the browser it's not loading.

  2. Complete and show javascript error in the console but when I refresh, it shows correct? What is the issue in Magento 2

7
  • Can you provide the javascript error screenshot.
    – Arjun
    Aug 11, 2016 at 9:18
  • thank arjun please check now these error come when i upload site first time but when i refresh this error not come and site work properly
    – imtiaz
    Aug 11, 2016 at 9:22
  • Are you facing these after 1st installation of magento2. The admin and frontend goes blank and shows error then follow this link and my answer over there magento.stackexchange.com/questions/130920/…
    – Arjun
    Aug 11, 2016 at 9:34
  • no no all is set it not first time it happen always when i run on new browser
    – imtiaz
    Aug 11, 2016 at 9:36
  • you can try it by either updating the browser version. Before that try to clear your browser cache and magento cache.
    – Arjun
    Aug 11, 2016 at 9:39

2 Answers 2

0

Last error solution:-

Uncaught TypeError: Cannot read property 'timepicker' of undefined

means that

$.ui

is undefined. So, you probably have not included jQuery UI.

Try to include it before any of your scripts (except jQuery itself).

2
  • ok but when i refresh its work
    – imtiaz
    Aug 11, 2016 at 9:31
  • @Arjun I am facing same issue so where can i include jQuery file in my website? Aug 17, 2018 at 10:44
0

Have you written any custom javascript? As the answer answer states you have an issue with jqueryui. Although to explain further you shouldn't need to include jquery or jquery ui. Just use requirejs to load it for you. For example

define([
    'jquery',
    'jquery/ui',
    'mage/accordion'
], function($) {
    $.widget('vendor.customAccordion', $.mage.accordion, {
        someAction: function(element) {
            // your code here
        }
    });
})

https://belvg.com/blog/how-to-use-jquery-and-requirejs-in-magento-2-javascript-solutions.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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