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

Allow the module to be used in Universal apps #22

Merged
merged 1 commit into from
Nov 12, 2015

Conversation

angelaigreja
Copy link
Contributor

jquery can not be initialised with nodeJs since there is no window or document.

jquery can not be initialised with nodeJs since there is no window or document.
skratchdot added a commit that referenced this pull request Nov 12, 2015
Allow the module to be used in Universal apps
@skratchdot skratchdot merged commit e394703 into skratchdot:master Nov 12, 2015
@ananddodia
Copy link

Still i am getting below mention error
ReferenceError: window is not defined
[1] at Object. (../node_modules/react-bootstrap-multiselect/dist/index.js:18:2)

Can you please fix it? or help me with a solution.
the issue is in this code.
if (typeof window !== 'undefined' && window && window.jQuery) {
$ = window.jQuery;
} else {
$ = require('jquery');
window.jQuery = $;
}

when we are already checking for 'window' object in if condition. We cannot use that in else clause.

@sman591
Copy link
Contributor

sman591 commented May 2, 2017

Ah, that's my mistake - I added window.jQuery in the else not fully realizing it's original purpose. I'll submit a PR to fix.

sman591 added a commit to sman591/react-bootstrap-multiselect that referenced this pull request May 2, 2017
Restores functionality introduced in skratchdot#22 but broken by skratchdot#71
@sman591
Copy link
Contributor

sman591 commented May 2, 2017

PR opened: #75

sman591 added a commit to sman591/react-bootstrap-multiselect that referenced this pull request May 3, 2017
Restores functionality introduced in skratchdot#22 but broken by skratchdot#71
@ananddodia
Copy link

thanks @sman591 for replying in short time.
After applying your patch. Now i am getting error in node_modules/bootstrap/js/transition.js:59:3
error is ReferenceError: jQuery is not defined
at Object. (/var/www/.../node_modules/bootstrap/js/transition.js:59:3)
I tried to debug and found that in jQuery object is not found. Can you please help?

@sman591
Copy link
Contributor

sman591 commented May 3, 2017

@ananddodia Looks like that might be due to changes #61 that introduced importing the boostrap package directly. This was reported in #73 - I posted a temporary workaround as well.

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

Successfully merging this pull request may close these issues.

4 participants