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

Marcucio require bug #366 #378

Merged
merged 2 commits into from
May 14, 2015
Merged

Marcucio require bug #366 #378

merged 2 commits into from
May 14, 2015

Conversation

tofumatt
Copy link
Member

Fixed merge conflicts in #366.

marcucio and others added 2 commits March 26, 2015 14:35
When I am running my qunit tests using karma I am getting this error when loading localforage library:

ReferenceError: Can't find variable: require

The issue is that qunit defines "module" and "module.exports" so this check we have passes (but require is undefined)

 if (typeof module !== 'undefined' && module.exports)
I have a fix for it, changing it to:

if (typeof module !== 'undefined' && module.exports && typeof require !== 'undefined')
fixes the issue. There might be a different fix when I set up karma or qunit but I didn't find one, and it might be good to check for require before using it.
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.

None yet

2 participants