Topic: Uncaught ReferenceError: Waves is not defined

Marvin Jaworski free asked 6 years ago


Hey, I´m using require.js in my project. mdb.js is loaded with jquery as dependency on require, but my chrome developertool says "Uncaught ReferenceError: Waves is not defined" when my website loads. Code of my main.js:
requirejs.config({
    baseUrl : './js',
    shim : {
        bootstrap : {
            deps : [ 'jquery'],
            exports: 'Bootstrap'
        },
        mdb : {
            deps : [ 'jquery'],
            exports: 'mdb'
        }
    },

    paths : {
        jquery : 'vendor/jquery.min',
        underscore : 'vendor/underscore',

        bootstrap : 'vendor/bootstrap.min',
        mdb : 'vendor/mdb.min',
        tether : 'vendor/tether.min',

        text : 'vendor/text',
        json : 'vendor/json',

        modules : '../modules',
        data : '../data'
    }
});

requirejs([ 'bootstrap', 'text', 'json', 'mdb', 'tether',
            'modules/slideshow/module', 'modules/flipCard/module', 'modules/accordion/module', 'modules/footer/module'],
            function() {

});
Can someone explain me how I solve the problem or how I load mdb.js generally correctly with require.js? Thanks, Marvin

ozcelebi free answered 5 years ago


is there a solid solution? 

After commenting those lines then "Uncaught TypeError: Cannot read property 'defaults' of undefined" is fired from line mdb.js:23672


Piotr Glejzer staff commented 5 years ago

I'm so sorry but we dont have solid solutfion for now. I put that to task 'to do'. Have a nice day.


Mirosław Stasiak free answered 6 years ago


Hello, Comment the following code lines in mdb.js. It should be good now. Waves.attach('.btn, .btn-floating', ['waves-light']); Waves.attach('.waves-light', ['waves-light']); Waves.attach('.navbar-nav a:not(.navbar-brand), .nav-icons li a, .navbar form, .nav-tabs .nav-item', ['waves-light']); Waves.attach('.pager li a', ['waves-light']); Waves.attach('.pagination .page-item .page-link', ['waves-effect']); Waves.init();/* FORMS */ Regards

Doug Kent free commented 6 years ago

This is a temporary work-around, right? Suppose we go ahead and comment out those lines. Will buttons no longer be able to have waves? What happens when we want to upgrade the version of mdb? We have to remember our little hack, and hope it works with the new version? Is there a real fix coming for this, any way we can help make that happen? Thanks!

est_dev pro commented 6 years ago

I would like to know this aswell


Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: General Bootstrap questions
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No