Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to initalise bootstrap-multiselect in npm #585

Closed
MiguelAngelRG opened this issue Jul 20, 2015 · 6 comments
Closed

Unable to initalise bootstrap-multiselect in npm #585

MiguelAngelRG opened this issue Jul 20, 2015 · 6 comments
Labels

Comments

@MiguelAngelRG
Copy link

Hi there,

I'm having issues on intalising the bootstrap-multiselect module in my web application. I am getting the following 'stacktrace'.

bootstrap-multiselect.js:1416
}(window.jQuery);
^
ReferenceError: window is not defined
at Object. (bootstrap-multiselect.js:1416:3)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (app.js:14:19)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)

@davidstutz
Copy link
Owner

Related: #584.

@thadclay
Copy link

I was able to get it working this way

var $ = require('jquery');
var multiselect = require('bootstrap-multiselect');
$.multiselect = multiselect;

$("#example").multiselect();

@davidstutz
Copy link
Owner

Will add this to the FAQ.

davidstutz added a commit that referenced this issue Jul 19, 2016
@UseMuse
Copy link

UseMuse commented Jun 24, 2021

Can't resolve 'knockout' in '...node_modules\bootstrap-multiselect\dist\js' not found

@melbazany
Copy link

Seconding @UseMuse. Anyone else have a solution? Potentially using 'import' syntax?

@danse-nr3
Copy link

Solution by @thadclay does not work, require fails. #1278 enables assigning jQuery to globalThis so that bootstrap-multiselect can find it defined

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants