Login with:


Or:


Not a member? Sign Up

Forgot Password?

Signup with:


Or:


Already have an account? Log in

Uncaught ReferenceError: Waves is not defined

Home Forums Material Design for Bootstrap Support Uncaught ReferenceError: Waves is not defined

Tagged: ,

This topic contains 9 replies, has 5 voices, and was last updated by  Daniel Munoz 1 week, 2 days ago.

Viewing 10 posts - 1 through 10 (of 10 total)
Version: MDB PRO 4.1.1
  • Author
    Posts
  • #11671

    marktopperdk
    Participant

    I am using MDB Pro 4.1.1 and loading the file mdb.js.

    However then I get the following error:

    Uncaught ReferenceError: Waves is not defined

    #11672

    marktopperdk
    Participant

    #11676

    marktopperdk
    Participant

    It’s because I am trying to combile it using webpack.

    #11701

    Please, contact me at b.malanowski@mdbootstrap.com

    #12283

    kisansimhae
    Participant

    I have the same problem.

    I’m trying to load mdb 4.2.0 into Aurelia using the aurelia-cli. It uses require.js as loader.
    I’m also getting this error from require.js: Uncaught Error: Mismatched anonymous define() module:

    #12670

    martin.rolph
    Participant

    I have the same issue. Has this been resolved?

    #12727

    @martin, could you please show me how do you import MDB?

    #13193

    Daniel Munoz
    Participant

    @bartek-malanowski, I’m having the same problem. I did an npm install mdbootstrap and added it to dependencies in aurelia.json.

    {
    “name”: “vendor-bundle.js”,
    “prepend”: [
    “node_modules/bluebird/js/browser/bluebird.core.js”,
    “node_modules/requirejs/require.js”
    ],
    “dependencies”: [
    …,
    “jquery”,
    {
    “main”: “js/mdb”,
    “name”: “mdbootstrap”,
    “path”: “../node_modules/mdbootstrap/”,
    “resources”: [
    “css/mdb.css”
    ]
    }

    When the path is pointed to mdb.js or mdb.min.js I get 3 Mismatch anonymous define() module: errors,

    Uncaught Error: Mismatched anonymous define() module: function (){
    return Chart;

    Uncaught Error: Mismatched anonymous define() module: function () {
    return factory.apply(window);
    }

    Mismatched anonymous define() module: function (){return function(e,t,r,a){function n(e){for(var t=-1,r=e?e.length:0,a=[];++t<r;)…………………………………and on

    #13253

    @daniel_munoz, do you get any other console logs?

    #13260

    Daniel Munoz
    Participant

    Hi @bartek-malanowski,”Waves is not defined” and those three mismatched errors are what I get. I am able to rid of the mismatched errors by manually adding a string ID to those three define() functions that return an error. The “Waves is undefined” error seems to arise because the function in the second parenthesis of the Waves IIFE doesn’t run before Waves initialization begins.

    (function (window, factory) {
    ‘use strict’;

    // AMD. Register as an anonymous module. Wrap in function so we have access
    // to root via this.
    if (typeof define === ‘function’ && define.amd) { // this statement is true, define is defined in my vendor-bundle.js, it’s undefined and does not run when running the tutorial.
    define(‘factory’, [], function () { // Added stringID to rid of this mismatched error.
    return factory.apply(window);
    });
    }

    // Node. Does not work with strict CommonJS, but only CommonJS-like
    // environments that support module.exports, like Node.
    else if (typeof exports === ‘object’) {
    module.exports = factory.call(window);
    }

    // Browser globals.
    else {
    window.Waves = factory.call(window); <– This runs in the getting started tutorial.
    }
    })(typeof global === ‘object’ ? global : this, function () { // This runs in the getting started tutorial and goes into the function to define Waves. In my vendor-bundle.js, I can breakpoint here but the function is completely skipped and it goes into Waves Initialization.
    ‘use strict’;

    var Waves = Waves || {}; //Doesn’t run in vendor-bundle.js

    …….
    return Waves;
    });

    //Initialization
    Waves.attach(‘.btn, .btn-floating’, [‘waves-light’]); //undefined in vendor-bundle.js since it skipped the function to define Waves, breaks my app.

    • This reply was modified 1 week, 2 days ago by  Daniel Munoz.
    • This reply was modified 1 week, 2 days ago by  Daniel Munoz.
Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.