title: Uncaught TypeError: $ is not a function, when trying to integrate external plugins into my Meteor app
body: <p>Trying to integrate a plugin that is not available as a package into my Meteor app. </p>
  
  <p>Here's the code:</p>
  
  <pre><code>import $ from "meteor/jquery";
  import jQuery from "meteor/jquery"
  
       (function($, window, document){
         'use strict';
  
           var doc = $(document);
  
           window.notifyAlert = function(){
  
             var $this  = $(this),
                 onload = $this.data('onload');
  
             if(onload !== undefined) {
               setTimeout(function(){
                 notifyNow($this);
               }, 800);
             }
  
             $this.on('click', function (e) {
               e.preventDefault();
               notifyNow($this);
             });
  
           }
  
           function notifyNow($element) {
             var message = $element.data('message'),
                 options = $element.data('options');
  
             if(!message)
               $.error('Notify: No message specified');
  
             $.notify(message, options || {});
           }
  
  
       }(jQuery, window, document));
  </code></pre>
  
  <p>Here's the error:</p>
  
  <pre><code>Uncaught TypeError: $ is not a function
  </code></pre>
  
  <p>I wrapped the function to be immediately invoked in the context of the jQuery object, since I thought that will surely help solve the problem and prevent interference with the global namespace, but nope, same problem.</p>
  
  <p>If you take take the immediate invocation out, obviously it won't work either. So I'm completely lost at what to do here.</p>
  
  <p>I only have this error when working with Meteor and nowhere else.</p>