Skip to content

Getting jQuery not defined when importing colcade #16

@ivandoric

Description

@ivandoric

Hi,

I keep getting:

Uncaught ReferenceError: jQuery is not defined
    at Object.<anonymous> (external "jQuery":1)
    at __webpack_require__ (bootstrap 946d2903250f93af9fc4:678)
    at fn (bootstrap 946d2903250f93af9fc4:88)
    at Object.<anonymous> (colcade.js:366)
    at __webpack_require__ (bootstrap 946d2903250f93af9fc4:678)
    at fn (bootstrap 946d2903250f93af9fc4:88)
    at Object.<anonymous> (masonry.js:1)
    at __webpack_require__ (bootstrap 946d2903250f93af9fc4:678)
    at fn (bootstrap 946d2903250f93af9fc4:88)
    at Object.<anonymous> (main.js:1)

When trying to import colcade: import Colcade from 'colcade'

It seems to me that the check for if jQuery is present is either not working correctly or is called at the wrong time, this part of the code here:

Colcade.makeJQueryPlugin = function( $ ) {
  $ = $ || window.jQuery;
  if ( !$ ) {
    return;
  }
...

When I delete that whole function everything works as it's supposed to. I'm of course not using jQuery in my project, just to be clear.

Anyway, liking the plugin so far :) .

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions