HubSpot / messenger

Growl-style alerts and messages for your app. #hubspot-open-source
http://github.hubspot.com/messenger/
MIT License
4.03k stars 408 forks source link

Cannot read property 'Message' of undefined #125

Open vinjex opened 6 years ago

vinjex commented 6 years ago

at messenger-theme-flat.js:27 })(window.Messenger.Message); and at messenger-theme-flat.js:33 }).call(this); I never changed the files so I don't understand what's causing this problem. This error causes Messenger to not use the theme and options and to show on top of the page This is how I post the notifications:

Messenger().post({
                    message: 'There was an explosion while processing your request.',
                    type: 'error',
                    showCloseButton: true
                });

using options:

Messenger.options = {
            extraClasses: 'messenger-fixed messenger-on-bottom',
            theme: 'flat'
        }

messenger-theme-flat.js:

(function() {
  var $, FlatMessage, spinner_template,
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  $ = jQuery;

  spinner_template = '<div class="messenger-spinner">\n    <span class="messenger-spinner-side messenger-spinner-side-left">\n        <span class="messenger-spinner-fill"></span>\n    </span>\n    <span class="messenger-spinner-side messenger-spinner-side-right">\n        <span class="messenger-spinner-fill"></span>\n    </span>\n</div>';

  FlatMessage = (function(_super) {

    __extends(FlatMessage, _super);

    function FlatMessage() {
      return FlatMessage.__super__.constructor.apply(this, arguments);
    }

    FlatMessage.prototype.template = function(opts) {
      var $message;
      $message = FlatMessage.__super__.template.apply(this, arguments);
      $message.append($(spinner_template));
      return $message;
    };

    return FlatMessage;

  })(window.Messenger.Message);

  window.Messenger.themes.flat = {
    Message: FlatMessage
  };

}).call(this);

image