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

Giving feedback to someone without sounding prejudiced

Pre-Employment Background Check With Consent For Future Checks

How to make money from a browser who sees 5 seconds into the future of any web page?

Quoting Keynes in a lecture

How do you justify more code being written by following clean code practices?

Do you waste sorcery points if you try to apply metamagic to a spell from a scroll but fail to cast it?

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

Typing CO_2 easily

What is the meaning of the following sentence?

Can you identify this lizard-like creature I observed in the UK?

What (the heck) is a Super Worm Equinox Moon?

Is there a RAID 0 Equivalent for RAM?

Animation: customize bounce interpolation

Sigmoid with a slope but no asymptotes?

What happens if I try to grapple an illusory duplicate from the Mirror Image spell?

Proving an identity involving cross products and coplanar vectors

The Digit Triangles

Why is the Sun approximated as a black body at ~ 5800 K?

Would this string work as string?

"Oh no!" in Latin

Ways of geometrical multiplication

Language involving irrational number is not a CFL

How to reduce predictors the right way for a logistic regression model

Is there anyway, I can have two passwords for my wi-fi



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













1















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


























    1















    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
























      1












      1








      1








      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 yesterday









      Hiren ShahHiren Shah

      5219




      5219




















          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

          Sum ergo cogito? 1 nng

          419 nièngy_Soadمي 19bal1.5o_g

          Queiggey Chernihivv 9NnOo i Zw X QqKk LpB