jquery.validate.min.js:4 Uncaught TypeError: Cannot read properties of undefined (reading 'mode')

Sometimes you get the error jquery.validate.min.js:4 Uncaught TypeError: Cannot read properties of undefined (reading 'mode') on calling ajax request using validate.js because of slim (version) of jQuery. You have to use normal jQuery version (jquery.min.js) instead of slim version

Answers 1
  • Use jquery.min.js instead of jquery.slim.min.js

    <!-- Use -->
    <script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
    <!-- Instead of -->
    <!-- <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script> -->
    
    0

    Jquery slim (version) does not contain the following method, jQuery.fn.extend ,jquery.fn.load, jquery.each, jQuery.expr.filters.animated
    ajax settings like jQuery.ajaxSettings.xhr, jQuery.ajaxPrefilter, jQuery.ajaxSetup, jQuery.ajaxPrefilter, jQuery.ajaxTransport, jQuery.ajaxSetup, xml parsing like jQuery.parseXML, animation effects like jQuery.easing, jQuery.Animation, jQuery.speedz. 

    You have to use jquery.min.js instead of jquery.slim.min.js in your html.

  • Back to code snippet queries related jquery