maciej-gurban / responsive-bootstrap-toolkit

Responsive Bootstrap Toolkit allows for easy breakpoint detection in JavaScript
MIT License
363 stars 89 forks source link

Can't find variable: module #41

Closed silentFred closed 8 years ago

silentFred commented 8 years ago

Hi there,

I noticed the latest version breaks in Karma using PhantomJS. It's this little bit here that causes it. It looks pretty safe to me so not sure why Karma is complaining. Any ideas?

if (module && module.exports) {
    module.exports = ResponsiveBootstrapToolkit;
}
maciej-gurban commented 8 years ago

Hi Frederick,

That's what I thought initially as well, but the correct check should be as follows:

if (typeof module !== 'undefined' && module.exports) {
    module.exports = ResponsiveBootstrapToolkit;
}

This has been pushed as a hotfix awhile ago, and it should be enough that you update the toolkit to version 2.6.3.

silentFred commented 8 years ago

Nice!

Sorry about that. I just pulled latest major :)