magento 2 Uncaught TypeError: Cannot read property 'version' of undefinedMagento 2.1 Uncaught TypeError: Cannot read property 'replace' of nullUncaught TypeError Porto Theme 2.1.0 Magento 2product quickview not working with infinite scrollUncaught TypeError: Cannot read property 'autocompleteIndex' of undefinedUncaught TypeError: Cannot read property 'nodeName' of undefined in custom js admin panelMagento 2, Cannot read property 'ui' of undefinedHow can I check if my attribute select option has been selected?jQuery UI breaks when clicking on draggable element: “Cannot read property 'defaultView' of undefined”Magento 2: Cannot read property 'dialog' of undefined, 'timepicker' of undefined,'RFC_2822' of undefinedMagento 2.2.5 - Uncaught TypeError: Cannot read property 'dialog' of undefined

Reason why a kingside attack is not justified

Would this string work as string?

Why do Radio Buttons not fill the entire outer circle?

How do I prevent inappropriate ads from appearing in my game?

If the Dominion rule using their Jem'Hadar troops, why is their life expectancy so low?

What do the positive and negative (+/-) transmit and receive pins mean on Ethernet cables?

What is the period/term used describe Giuseppe Arcimboldo's style of painting?

What is the tangent at a sharp point on a curve?

How can a new country break out from a developed country without war?

Offset in split text content

Relations between homogeneous polynomials

What is the purpose of using a decision tree?

I keep switching characters, how do I stop?

Is there a POSIX way to shutdown a UNIX machine?

Showing mass murder in a kid's book

"Oh no!" in Latin

Reasons for having MCU pin-states default to pull-up/down out of reset

How do you say "Trust your struggle." in French?

How would a solely written language work mechanically

Should I warn a new PhD Student?

How can I, as DM, avoid the Conga Line of Death occurring when implementing some form of flanking rule?

Does capillary rise violate hydrostatic paradox?

Friend wants my recommendation but I don't want to give it to him

What should be the ideal length of sentences in a blog post for ease of reading?



magento 2 Uncaught TypeError: Cannot read property 'version' of undefined


Magento 2.1 Uncaught TypeError: Cannot read property 'replace' of nullUncaught TypeError Porto Theme 2.1.0 Magento 2product quickview not working with infinite scrollUncaught TypeError: Cannot read property 'autocompleteIndex' of undefinedUncaught TypeError: Cannot read property 'nodeName' of undefined in custom js admin panelMagento 2, Cannot read property 'ui' of undefinedHow can I check if my attribute select option has been selected?jQuery UI breaks when clicking on draggable element: “Cannot read property 'defaultView' of undefined”Magento 2: Cannot read property 'dialog' of undefined, 'timepicker' of undefined,'RFC_2822' of undefinedMagento 2.2.5 - Uncaught TypeError: Cannot read property 'dialog' of undefined













0















I got below error randomly in front-end and when all modal popup not working when below error occurs.
Uncaught TypeError: Cannot read property 'version' of undefined



enter image description here



I have override admin product-gallery.js and its working fine.



requirejs-config.js



var config = 
config:
mixins:
'Magento_Catalog/js/product-gallery':
'Hs_Mageenhancement/js/product-gallery-mixin': true



;


Below is the code of product-gallery-mixin.js and path of js is app/code/Hs/Mageenhancement/view/adminhtml/web/js/product-gallery-mixin.js



define([
'jquery',
'underscore',
'mage/template',
'uiRegistry'
], function($, _, mageTemplate, registry)
'use strict';
return function (widget)
$.widget('mage.productGallery', widget,
/**
* Initializes dialog element.
*/
_initDialog: function ()
var $dialog = $(this.dialogContainerTmpl());

$dialog.modal(
'type': 'slide',
title: $.mage.__('Image Detail'),
buttons: [],

/** @inheritdoc */
opened: function ()
$dialog.trigger('open');
,

/** @inheritdoc */
closed: function ()
$dialog.trigger('close');

);

$dialog.on('open', this.onDialogOpen.bind(this));
$dialog.on('close', function ()
var $imageContainer = $dialog.data('imageContainer');

$imageContainer.removeClass('active');
$dialog.find('#hide-from-product-page').remove();
);

$dialog.on('change', '[data-role=type-selector]', function ()
var parent = $(this).closest('.item'),
selectedClass = 'selected';

parent.toggleClass(selectedClass, $(this).prop('checked'));
);

$dialog.on('change', '[data-role=type-selector]', $.proxy(this._notifyType, this));

$dialog.on('change', '[data-role=visibility-trigger]', $.proxy(function (e)
var imageData = $dialog.data('imageData');

this.element.trigger('updateVisibility',
disabled: $(e.currentTarget).is(':checked'),
imageData: imageData
);
, this));

$dialog.on('change', '[data-role="image-description"]', function (e)
var target = $(e.target),
targetName = target.attr('name'),
desc = target.val(),
imageData = $dialog.data('imageData');

this.element.find('input[type="hidden"][name="' + targetName + '"]').val(desc);

imageData.label = desc;
imageData['label_default'] = desc;

this.element.trigger('updateImageTitle',
imageData: imageData
);
.bind(this));

$dialog.on('change', '[data-role=image-related-tire-price]', $.proxy(function (e)
var target = $(e.target),
targetName = target.attr('name'),
tirePriceQty = target.val(),
imageData = $dialog.data('imageData');

this.element.find('input[type="hidden"][name="' + targetName + '"]').val(tirePriceQty);
, this));

this.$dialog = $dialog;

);
return $.mage.productGallery;

);


Also added popup code into .phtml file.



<script>
require(
[
'jquery',
'Magento_Ui/js/modal/modal'
],
function(
$,
modal
)
var contactOptions =
type: 'popup',
title: $.mage.__('Contact Us'),
responsive: true,
innerScroll: false,
buttons: [
text: $.mage.__('Close'),
class: '',
click: function ()
this.closeModal();

]
;

var contactPopup = modal(contactOptions, $('#contact-popup-mpdal'));
$("#ContactUsModal").on('click',function()
$("#contact-popup-mpdal").modal("openModal");
);

var pricePromiseOptions =
type: 'popup',
title: $.mage.__('Price Match Promise Terms and Conditions'),
responsive: true,
innerScroll: false,
buttons: [
text: $.mage.__('Close'),
class: '',
click: function ()
this.closeModal();

]
;

var pricePromisePopup = modal(pricePromiseOptions, $('#price-promise-popup-mpdal'));
$("#price_promise").on('click',function()
$("#price-promise-popup-mpdal").modal("openModal");
);

var privacyPolicyOptions =
type: 'popup',
title: $.mage.__('Privacy Policy'),
responsive: true,
innerScroll: false,
buttons: [
text: $.mage.__('Close'),
class: '',
click: function ()
this.closeModal();

]
;

var privacyPolicyPopup = modal(privacyPolicyOptions, $('#privacy-policy-popup-mpdal'));
$("#privacy_policy").on('click',function()
$("#privacy-policy-popup-mpdal").modal("openModal");
);

var cookiesPolicyOptions =
type: 'popup',
title: $.mage.__('Cookie Policy'),
responsive: true,
innerScroll: false,
buttons: [
text: $.mage.__('Close'),
class: '',
click: function ()
this.closeModal();

]
;

var cookiesPolicyPopup = modal(cookiesPolicyOptions, $('#cookie-policy-popup-mpdal'));
$("#cookies_policy").on('click',function()
$("#cookie-policy-popup-mpdal").modal("openModal");
);

var termsConditionOptions =
type: 'popup',
title: $.mage.__('Terms and Conditions'),
responsive: true,
innerScroll: false,
buttons: [
text: $.mage.__('Close'),
class: '',
click: function ()
this.closeModal();

]
;

var termsConditionPopup = modal(termsConditionOptions, $('#terms-condition-popup-mpdal'));
$("#TermsCondiModal").on('click',function()
$("#terms-condition-popup-mpdal").modal("openModal");
);


);
</script>


Another popup code as below.



<script>
require(
[
'jquery',
'Magento_Ui/js/modal/modal',
'mage/validation'
],
function(
$,
modal
)
jQuery(document).ready(function()
var options =
type: 'popup',
title: $.mage.__('All Reviews'),
responsive: true,
innerScroll: false,
buttons: [
text: $.mage.__('Close'),
class: '',
click: function ()
this.closeModal();

]
;

var popup = modal(options, $('#list-review-popup-mpdal'));
jQuery("#ListReview").on('click',function()
jQuery("#list-review-popup-mpdal").modal("openModal");
);

var reviewFormOptions =
type: 'popup',
title: $.mage.__('Write a Review'),
responsive: true,
innerScroll: true,
buttons: [
text: $.mage.__('Close'),
class: '',
click: function ()
this.closeModal();

]
;

var reviewFormPopup = modal(reviewFormOptions, $('#submit-review-popup-mpdal'));
jQuery("#SubmitReview").on('click',function()
jQuery("#submit-review-popup-mpdal").modal("openModal");
);

var dataForm = $('#review-form');
dataForm.mage('validation', );
jQuery('body').on('click', '#review-form .action.submit', function(e)
e.preventDefault();
e.stopImmediatePropagation();
if(dataForm.validation('isValid'))
jQuery.ajax(
type: 'post',
url: jQuery('#review-form').attr('action'),
data: jQuery('#review-form').serialize(),
cache: false,
showLoader: 'true',
success: function(response)
var message = response.message;
if(response.success)
jQuery('#feedback_review').removeClass('error-msg');
jQuery('#feedback_review').addClass('Succ-msg');
else
jQuery('#feedback_review').removeClass('Succ-msg');
jQuery('#feedback_review').addClass('error-msg');

jQuery('#feedback_review').html(message).show();

);

return false;
);

);

);
</script>


Is there any issue related to popups?



Please help to resolve issue.










share|improve this question


























    0















    I got below error randomly in front-end and when all modal popup not working when below error occurs.
    Uncaught TypeError: Cannot read property 'version' of undefined



    enter image description here



    I have override admin product-gallery.js and its working fine.



    requirejs-config.js



    var config = 
    config:
    mixins:
    'Magento_Catalog/js/product-gallery':
    'Hs_Mageenhancement/js/product-gallery-mixin': true



    ;


    Below is the code of product-gallery-mixin.js and path of js is app/code/Hs/Mageenhancement/view/adminhtml/web/js/product-gallery-mixin.js



    define([
    'jquery',
    'underscore',
    'mage/template',
    'uiRegistry'
    ], function($, _, mageTemplate, registry)
    'use strict';
    return function (widget)
    $.widget('mage.productGallery', widget,
    /**
    * Initializes dialog element.
    */
    _initDialog: function ()
    var $dialog = $(this.dialogContainerTmpl());

    $dialog.modal(
    'type': 'slide',
    title: $.mage.__('Image Detail'),
    buttons: [],

    /** @inheritdoc */
    opened: function ()
    $dialog.trigger('open');
    ,

    /** @inheritdoc */
    closed: function ()
    $dialog.trigger('close');

    );

    $dialog.on('open', this.onDialogOpen.bind(this));
    $dialog.on('close', function ()
    var $imageContainer = $dialog.data('imageContainer');

    $imageContainer.removeClass('active');
    $dialog.find('#hide-from-product-page').remove();
    );

    $dialog.on('change', '[data-role=type-selector]', function ()
    var parent = $(this).closest('.item'),
    selectedClass = 'selected';

    parent.toggleClass(selectedClass, $(this).prop('checked'));
    );

    $dialog.on('change', '[data-role=type-selector]', $.proxy(this._notifyType, this));

    $dialog.on('change', '[data-role=visibility-trigger]', $.proxy(function (e)
    var imageData = $dialog.data('imageData');

    this.element.trigger('updateVisibility',
    disabled: $(e.currentTarget).is(':checked'),
    imageData: imageData
    );
    , this));

    $dialog.on('change', '[data-role="image-description"]', function (e)
    var target = $(e.target),
    targetName = target.attr('name'),
    desc = target.val(),
    imageData = $dialog.data('imageData');

    this.element.find('input[type="hidden"][name="' + targetName + '"]').val(desc);

    imageData.label = desc;
    imageData['label_default'] = desc;

    this.element.trigger('updateImageTitle',
    imageData: imageData
    );
    .bind(this));

    $dialog.on('change', '[data-role=image-related-tire-price]', $.proxy(function (e)
    var target = $(e.target),
    targetName = target.attr('name'),
    tirePriceQty = target.val(),
    imageData = $dialog.data('imageData');

    this.element.find('input[type="hidden"][name="' + targetName + '"]').val(tirePriceQty);
    , this));

    this.$dialog = $dialog;

    );
    return $.mage.productGallery;

    );


    Also added popup code into .phtml file.



    <script>
    require(
    [
    'jquery',
    'Magento_Ui/js/modal/modal'
    ],
    function(
    $,
    modal
    )
    var contactOptions =
    type: 'popup',
    title: $.mage.__('Contact Us'),
    responsive: true,
    innerScroll: false,
    buttons: [
    text: $.mage.__('Close'),
    class: '',
    click: function ()
    this.closeModal();

    ]
    ;

    var contactPopup = modal(contactOptions, $('#contact-popup-mpdal'));
    $("#ContactUsModal").on('click',function()
    $("#contact-popup-mpdal").modal("openModal");
    );

    var pricePromiseOptions =
    type: 'popup',
    title: $.mage.__('Price Match Promise Terms and Conditions'),
    responsive: true,
    innerScroll: false,
    buttons: [
    text: $.mage.__('Close'),
    class: '',
    click: function ()
    this.closeModal();

    ]
    ;

    var pricePromisePopup = modal(pricePromiseOptions, $('#price-promise-popup-mpdal'));
    $("#price_promise").on('click',function()
    $("#price-promise-popup-mpdal").modal("openModal");
    );

    var privacyPolicyOptions =
    type: 'popup',
    title: $.mage.__('Privacy Policy'),
    responsive: true,
    innerScroll: false,
    buttons: [
    text: $.mage.__('Close'),
    class: '',
    click: function ()
    this.closeModal();

    ]
    ;

    var privacyPolicyPopup = modal(privacyPolicyOptions, $('#privacy-policy-popup-mpdal'));
    $("#privacy_policy").on('click',function()
    $("#privacy-policy-popup-mpdal").modal("openModal");
    );

    var cookiesPolicyOptions =
    type: 'popup',
    title: $.mage.__('Cookie Policy'),
    responsive: true,
    innerScroll: false,
    buttons: [
    text: $.mage.__('Close'),
    class: '',
    click: function ()
    this.closeModal();

    ]
    ;

    var cookiesPolicyPopup = modal(cookiesPolicyOptions, $('#cookie-policy-popup-mpdal'));
    $("#cookies_policy").on('click',function()
    $("#cookie-policy-popup-mpdal").modal("openModal");
    );

    var termsConditionOptions =
    type: 'popup',
    title: $.mage.__('Terms and Conditions'),
    responsive: true,
    innerScroll: false,
    buttons: [
    text: $.mage.__('Close'),
    class: '',
    click: function ()
    this.closeModal();

    ]
    ;

    var termsConditionPopup = modal(termsConditionOptions, $('#terms-condition-popup-mpdal'));
    $("#TermsCondiModal").on('click',function()
    $("#terms-condition-popup-mpdal").modal("openModal");
    );


    );
    </script>


    Another popup code as below.



    <script>
    require(
    [
    'jquery',
    'Magento_Ui/js/modal/modal',
    'mage/validation'
    ],
    function(
    $,
    modal
    )
    jQuery(document).ready(function()
    var options =
    type: 'popup',
    title: $.mage.__('All Reviews'),
    responsive: true,
    innerScroll: false,
    buttons: [
    text: $.mage.__('Close'),
    class: '',
    click: function ()
    this.closeModal();

    ]
    ;

    var popup = modal(options, $('#list-review-popup-mpdal'));
    jQuery("#ListReview").on('click',function()
    jQuery("#list-review-popup-mpdal").modal("openModal");
    );

    var reviewFormOptions =
    type: 'popup',
    title: $.mage.__('Write a Review'),
    responsive: true,
    innerScroll: true,
    buttons: [
    text: $.mage.__('Close'),
    class: '',
    click: function ()
    this.closeModal();

    ]
    ;

    var reviewFormPopup = modal(reviewFormOptions, $('#submit-review-popup-mpdal'));
    jQuery("#SubmitReview").on('click',function()
    jQuery("#submit-review-popup-mpdal").modal("openModal");
    );

    var dataForm = $('#review-form');
    dataForm.mage('validation', );
    jQuery('body').on('click', '#review-form .action.submit', function(e)
    e.preventDefault();
    e.stopImmediatePropagation();
    if(dataForm.validation('isValid'))
    jQuery.ajax(
    type: 'post',
    url: jQuery('#review-form').attr('action'),
    data: jQuery('#review-form').serialize(),
    cache: false,
    showLoader: 'true',
    success: function(response)
    var message = response.message;
    if(response.success)
    jQuery('#feedback_review').removeClass('error-msg');
    jQuery('#feedback_review').addClass('Succ-msg');
    else
    jQuery('#feedback_review').removeClass('Succ-msg');
    jQuery('#feedback_review').addClass('error-msg');

    jQuery('#feedback_review').html(message).show();

    );

    return false;
    );

    );

    );
    </script>


    Is there any issue related to popups?



    Please help to resolve issue.










    share|improve this question
























      0












      0








      0








      I got below error randomly in front-end and when all modal popup not working when below error occurs.
      Uncaught TypeError: Cannot read property 'version' of undefined



      enter image description here



      I have override admin product-gallery.js and its working fine.



      requirejs-config.js



      var config = 
      config:
      mixins:
      'Magento_Catalog/js/product-gallery':
      'Hs_Mageenhancement/js/product-gallery-mixin': true



      ;


      Below is the code of product-gallery-mixin.js and path of js is app/code/Hs/Mageenhancement/view/adminhtml/web/js/product-gallery-mixin.js



      define([
      'jquery',
      'underscore',
      'mage/template',
      'uiRegistry'
      ], function($, _, mageTemplate, registry)
      'use strict';
      return function (widget)
      $.widget('mage.productGallery', widget,
      /**
      * Initializes dialog element.
      */
      _initDialog: function ()
      var $dialog = $(this.dialogContainerTmpl());

      $dialog.modal(
      'type': 'slide',
      title: $.mage.__('Image Detail'),
      buttons: [],

      /** @inheritdoc */
      opened: function ()
      $dialog.trigger('open');
      ,

      /** @inheritdoc */
      closed: function ()
      $dialog.trigger('close');

      );

      $dialog.on('open', this.onDialogOpen.bind(this));
      $dialog.on('close', function ()
      var $imageContainer = $dialog.data('imageContainer');

      $imageContainer.removeClass('active');
      $dialog.find('#hide-from-product-page').remove();
      );

      $dialog.on('change', '[data-role=type-selector]', function ()
      var parent = $(this).closest('.item'),
      selectedClass = 'selected';

      parent.toggleClass(selectedClass, $(this).prop('checked'));
      );

      $dialog.on('change', '[data-role=type-selector]', $.proxy(this._notifyType, this));

      $dialog.on('change', '[data-role=visibility-trigger]', $.proxy(function (e)
      var imageData = $dialog.data('imageData');

      this.element.trigger('updateVisibility',
      disabled: $(e.currentTarget).is(':checked'),
      imageData: imageData
      );
      , this));

      $dialog.on('change', '[data-role="image-description"]', function (e)
      var target = $(e.target),
      targetName = target.attr('name'),
      desc = target.val(),
      imageData = $dialog.data('imageData');

      this.element.find('input[type="hidden"][name="' + targetName + '"]').val(desc);

      imageData.label = desc;
      imageData['label_default'] = desc;

      this.element.trigger('updateImageTitle',
      imageData: imageData
      );
      .bind(this));

      $dialog.on('change', '[data-role=image-related-tire-price]', $.proxy(function (e)
      var target = $(e.target),
      targetName = target.attr('name'),
      tirePriceQty = target.val(),
      imageData = $dialog.data('imageData');

      this.element.find('input[type="hidden"][name="' + targetName + '"]').val(tirePriceQty);
      , this));

      this.$dialog = $dialog;

      );
      return $.mage.productGallery;

      );


      Also added popup code into .phtml file.



      <script>
      require(
      [
      'jquery',
      'Magento_Ui/js/modal/modal'
      ],
      function(
      $,
      modal
      )
      var contactOptions =
      type: 'popup',
      title: $.mage.__('Contact Us'),
      responsive: true,
      innerScroll: false,
      buttons: [
      text: $.mage.__('Close'),
      class: '',
      click: function ()
      this.closeModal();

      ]
      ;

      var contactPopup = modal(contactOptions, $('#contact-popup-mpdal'));
      $("#ContactUsModal").on('click',function()
      $("#contact-popup-mpdal").modal("openModal");
      );

      var pricePromiseOptions =
      type: 'popup',
      title: $.mage.__('Price Match Promise Terms and Conditions'),
      responsive: true,
      innerScroll: false,
      buttons: [
      text: $.mage.__('Close'),
      class: '',
      click: function ()
      this.closeModal();

      ]
      ;

      var pricePromisePopup = modal(pricePromiseOptions, $('#price-promise-popup-mpdal'));
      $("#price_promise").on('click',function()
      $("#price-promise-popup-mpdal").modal("openModal");
      );

      var privacyPolicyOptions =
      type: 'popup',
      title: $.mage.__('Privacy Policy'),
      responsive: true,
      innerScroll: false,
      buttons: [
      text: $.mage.__('Close'),
      class: '',
      click: function ()
      this.closeModal();

      ]
      ;

      var privacyPolicyPopup = modal(privacyPolicyOptions, $('#privacy-policy-popup-mpdal'));
      $("#privacy_policy").on('click',function()
      $("#privacy-policy-popup-mpdal").modal("openModal");
      );

      var cookiesPolicyOptions =
      type: 'popup',
      title: $.mage.__('Cookie Policy'),
      responsive: true,
      innerScroll: false,
      buttons: [
      text: $.mage.__('Close'),
      class: '',
      click: function ()
      this.closeModal();

      ]
      ;

      var cookiesPolicyPopup = modal(cookiesPolicyOptions, $('#cookie-policy-popup-mpdal'));
      $("#cookies_policy").on('click',function()
      $("#cookie-policy-popup-mpdal").modal("openModal");
      );

      var termsConditionOptions =
      type: 'popup',
      title: $.mage.__('Terms and Conditions'),
      responsive: true,
      innerScroll: false,
      buttons: [
      text: $.mage.__('Close'),
      class: '',
      click: function ()
      this.closeModal();

      ]
      ;

      var termsConditionPopup = modal(termsConditionOptions, $('#terms-condition-popup-mpdal'));
      $("#TermsCondiModal").on('click',function()
      $("#terms-condition-popup-mpdal").modal("openModal");
      );


      );
      </script>


      Another popup code as below.



      <script>
      require(
      [
      'jquery',
      'Magento_Ui/js/modal/modal',
      'mage/validation'
      ],
      function(
      $,
      modal
      )
      jQuery(document).ready(function()
      var options =
      type: 'popup',
      title: $.mage.__('All Reviews'),
      responsive: true,
      innerScroll: false,
      buttons: [
      text: $.mage.__('Close'),
      class: '',
      click: function ()
      this.closeModal();

      ]
      ;

      var popup = modal(options, $('#list-review-popup-mpdal'));
      jQuery("#ListReview").on('click',function()
      jQuery("#list-review-popup-mpdal").modal("openModal");
      );

      var reviewFormOptions =
      type: 'popup',
      title: $.mage.__('Write a Review'),
      responsive: true,
      innerScroll: true,
      buttons: [
      text: $.mage.__('Close'),
      class: '',
      click: function ()
      this.closeModal();

      ]
      ;

      var reviewFormPopup = modal(reviewFormOptions, $('#submit-review-popup-mpdal'));
      jQuery("#SubmitReview").on('click',function()
      jQuery("#submit-review-popup-mpdal").modal("openModal");
      );

      var dataForm = $('#review-form');
      dataForm.mage('validation', );
      jQuery('body').on('click', '#review-form .action.submit', function(e)
      e.preventDefault();
      e.stopImmediatePropagation();
      if(dataForm.validation('isValid'))
      jQuery.ajax(
      type: 'post',
      url: jQuery('#review-form').attr('action'),
      data: jQuery('#review-form').serialize(),
      cache: false,
      showLoader: 'true',
      success: function(response)
      var message = response.message;
      if(response.success)
      jQuery('#feedback_review').removeClass('error-msg');
      jQuery('#feedback_review').addClass('Succ-msg');
      else
      jQuery('#feedback_review').removeClass('Succ-msg');
      jQuery('#feedback_review').addClass('error-msg');

      jQuery('#feedback_review').html(message).show();

      );

      return false;
      );

      );

      );
      </script>


      Is there any issue related to popups?



      Please help to resolve issue.










      share|improve this question














      I got below error randomly in front-end and when all modal popup not working when below error occurs.
      Uncaught TypeError: Cannot read property 'version' of undefined



      enter image description here



      I have override admin product-gallery.js and its working fine.



      requirejs-config.js



      var config = 
      config:
      mixins:
      'Magento_Catalog/js/product-gallery':
      'Hs_Mageenhancement/js/product-gallery-mixin': true



      ;


      Below is the code of product-gallery-mixin.js and path of js is app/code/Hs/Mageenhancement/view/adminhtml/web/js/product-gallery-mixin.js



      define([
      'jquery',
      'underscore',
      'mage/template',
      'uiRegistry'
      ], function($, _, mageTemplate, registry)
      'use strict';
      return function (widget)
      $.widget('mage.productGallery', widget,
      /**
      * Initializes dialog element.
      */
      _initDialog: function ()
      var $dialog = $(this.dialogContainerTmpl());

      $dialog.modal(
      'type': 'slide',
      title: $.mage.__('Image Detail'),
      buttons: [],

      /** @inheritdoc */
      opened: function ()
      $dialog.trigger('open');
      ,

      /** @inheritdoc */
      closed: function ()
      $dialog.trigger('close');

      );

      $dialog.on('open', this.onDialogOpen.bind(this));
      $dialog.on('close', function ()
      var $imageContainer = $dialog.data('imageContainer');

      $imageContainer.removeClass('active');
      $dialog.find('#hide-from-product-page').remove();
      );

      $dialog.on('change', '[data-role=type-selector]', function ()
      var parent = $(this).closest('.item'),
      selectedClass = 'selected';

      parent.toggleClass(selectedClass, $(this).prop('checked'));
      );

      $dialog.on('change', '[data-role=type-selector]', $.proxy(this._notifyType, this));

      $dialog.on('change', '[data-role=visibility-trigger]', $.proxy(function (e)
      var imageData = $dialog.data('imageData');

      this.element.trigger('updateVisibility',
      disabled: $(e.currentTarget).is(':checked'),
      imageData: imageData
      );
      , this));

      $dialog.on('change', '[data-role="image-description"]', function (e)
      var target = $(e.target),
      targetName = target.attr('name'),
      desc = target.val(),
      imageData = $dialog.data('imageData');

      this.element.find('input[type="hidden"][name="' + targetName + '"]').val(desc);

      imageData.label = desc;
      imageData['label_default'] = desc;

      this.element.trigger('updateImageTitle',
      imageData: imageData
      );
      .bind(this));

      $dialog.on('change', '[data-role=image-related-tire-price]', $.proxy(function (e)
      var target = $(e.target),
      targetName = target.attr('name'),
      tirePriceQty = target.val(),
      imageData = $dialog.data('imageData');

      this.element.find('input[type="hidden"][name="' + targetName + '"]').val(tirePriceQty);
      , this));

      this.$dialog = $dialog;

      );
      return $.mage.productGallery;

      );


      Also added popup code into .phtml file.



      <script>
      require(
      [
      'jquery',
      'Magento_Ui/js/modal/modal'
      ],
      function(
      $,
      modal
      )
      var contactOptions =
      type: 'popup',
      title: $.mage.__('Contact Us'),
      responsive: true,
      innerScroll: false,
      buttons: [
      text: $.mage.__('Close'),
      class: '',
      click: function ()
      this.closeModal();

      ]
      ;

      var contactPopup = modal(contactOptions, $('#contact-popup-mpdal'));
      $("#ContactUsModal").on('click',function()
      $("#contact-popup-mpdal").modal("openModal");
      );

      var pricePromiseOptions =
      type: 'popup',
      title: $.mage.__('Price Match Promise Terms and Conditions'),
      responsive: true,
      innerScroll: false,
      buttons: [
      text: $.mage.__('Close'),
      class: '',
      click: function ()
      this.closeModal();

      ]
      ;

      var pricePromisePopup = modal(pricePromiseOptions, $('#price-promise-popup-mpdal'));
      $("#price_promise").on('click',function()
      $("#price-promise-popup-mpdal").modal("openModal");
      );

      var privacyPolicyOptions =
      type: 'popup',
      title: $.mage.__('Privacy Policy'),
      responsive: true,
      innerScroll: false,
      buttons: [
      text: $.mage.__('Close'),
      class: '',
      click: function ()
      this.closeModal();

      ]
      ;

      var privacyPolicyPopup = modal(privacyPolicyOptions, $('#privacy-policy-popup-mpdal'));
      $("#privacy_policy").on('click',function()
      $("#privacy-policy-popup-mpdal").modal("openModal");
      );

      var cookiesPolicyOptions =
      type: 'popup',
      title: $.mage.__('Cookie Policy'),
      responsive: true,
      innerScroll: false,
      buttons: [
      text: $.mage.__('Close'),
      class: '',
      click: function ()
      this.closeModal();

      ]
      ;

      var cookiesPolicyPopup = modal(cookiesPolicyOptions, $('#cookie-policy-popup-mpdal'));
      $("#cookies_policy").on('click',function()
      $("#cookie-policy-popup-mpdal").modal("openModal");
      );

      var termsConditionOptions =
      type: 'popup',
      title: $.mage.__('Terms and Conditions'),
      responsive: true,
      innerScroll: false,
      buttons: [
      text: $.mage.__('Close'),
      class: '',
      click: function ()
      this.closeModal();

      ]
      ;

      var termsConditionPopup = modal(termsConditionOptions, $('#terms-condition-popup-mpdal'));
      $("#TermsCondiModal").on('click',function()
      $("#terms-condition-popup-mpdal").modal("openModal");
      );


      );
      </script>


      Another popup code as below.



      <script>
      require(
      [
      'jquery',
      'Magento_Ui/js/modal/modal',
      'mage/validation'
      ],
      function(
      $,
      modal
      )
      jQuery(document).ready(function()
      var options =
      type: 'popup',
      title: $.mage.__('All Reviews'),
      responsive: true,
      innerScroll: false,
      buttons: [
      text: $.mage.__('Close'),
      class: '',
      click: function ()
      this.closeModal();

      ]
      ;

      var popup = modal(options, $('#list-review-popup-mpdal'));
      jQuery("#ListReview").on('click',function()
      jQuery("#list-review-popup-mpdal").modal("openModal");
      );

      var reviewFormOptions =
      type: 'popup',
      title: $.mage.__('Write a Review'),
      responsive: true,
      innerScroll: true,
      buttons: [
      text: $.mage.__('Close'),
      class: '',
      click: function ()
      this.closeModal();

      ]
      ;

      var reviewFormPopup = modal(reviewFormOptions, $('#submit-review-popup-mpdal'));
      jQuery("#SubmitReview").on('click',function()
      jQuery("#submit-review-popup-mpdal").modal("openModal");
      );

      var dataForm = $('#review-form');
      dataForm.mage('validation', );
      jQuery('body').on('click', '#review-form .action.submit', function(e)
      e.preventDefault();
      e.stopImmediatePropagation();
      if(dataForm.validation('isValid'))
      jQuery.ajax(
      type: 'post',
      url: jQuery('#review-form').attr('action'),
      data: jQuery('#review-form').serialize(),
      cache: false,
      showLoader: 'true',
      success: function(response)
      var message = response.message;
      if(response.success)
      jQuery('#feedback_review').removeClass('error-msg');
      jQuery('#feedback_review').addClass('Succ-msg');
      else
      jQuery('#feedback_review').removeClass('Succ-msg');
      jQuery('#feedback_review').addClass('error-msg');

      jQuery('#feedback_review').html(message).show();

      );

      return false;
      );

      );

      );
      </script>


      Is there any issue related to popups?



      Please help to resolve issue.







      jquery magento2.3.0 modal-popup requirejs-config.js console






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 42 mins ago









      Hiren ShahHiren Shah

      4719




      4719




















          0






          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "479"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f266592%2fmagento-2-uncaught-typeerror-cannot-read-property-version-of-undefined%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Magento Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f266592%2fmagento-2-uncaught-typeerror-cannot-read-property-version-of-undefined%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Magento 2 duplicate PHPSESSID cookie when using session_start() in custom php scriptMagento 2: User cant logged in into to account page, no error showing!Magento duplicate on subdomainGrabbing storeview from cookie (after using language selector)How do I run php custom script on magento2Magento 2: Include PHP script in headerSession lock after using Cm_RedisSessionscript php to update stockMagento set cookie popupMagento 2 session id cookie - where to find it?How to import Configurable product from csv with custom attributes using php scriptMagento 2 run custom PHP script

          Can not update quote_id field of “quote_item” table magento 2Magento 2.1 - We can't remove the item. (Shopping Cart doesnt allow us to remove items before becomes empty)Add value for custom quote item attribute using REST apiREST API endpoint v1/carts/cartId/items always returns error messageCorrect way to save entries to databaseHow to remove all associated quote objects of a customer completelyMagento 2 - Save value from custom input field to quote_itemGet quote_item data using quote id and product id filter in Magento 2How to set additional data to quote_item table from controller in Magento 2?What is the purpose of additional_data column in quote_item table in magento2Set Custom Price to Quote item magento2 from controller

          How to solve knockout JS error in Magento 2 Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?(Magento2) knockout.js:3012 Uncaught ReferenceError: Unable to process bindingUnable to process binding Knockout.js magento 2Cannot read property `scopeLabel` of undefined on Product Detail PageCan't get Customer Data on frontend in Magento 2Magento2 Order Summary - unable to process bindingKO templates are not loading in Magento 2.1 applicationgetting knockout js error magento 2Product grid not load -— Unable to process binding Knockout.js magento 2Product form not loaded in magento2Uncaught ReferenceError: Unable to process binding “if: function()return (isShowLegend()) ” magento 2