-
Notifications
You must be signed in to change notification settings - Fork 378
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
jQuery is not defined #236
Comments
A little more info… here’s what the built file looks like: define('global', function (require, exports, module) {
require('funcunit');
var FuncUnit = window.FuncUnit || {};
window.jQuery = jQuery;
module.exports = FuncUnit;
}); I put a debugger statement before
|
Sounds like the global module is wrong then. I don't know where this module is but if it wants to set jQuery on the window it should be importing it from within FuncUnit now. Having jQuery be a global in the non-global build was a longstanding cause of pain for people. |
Here’s that issue I think: Do not set window.jQuery I think this is the global module: https://github.com/bitovi/funcunit/blob/master/global.js Is the solution to add Or should this line: Line 4 in bbc3c16
…be changed to: window.jQuery = FuncUnit.jQuery; …or should the global build not set I’m not familiar with how FuncUnit is supposed to work with its own version of jQuery vs. imported versions, hence the uncertainty on my end. 😬 |
I'd say not set window.jQuery at all. FuncUnit uses it internally, but uses its own version now that is gets through the module loader. So I don't think setting window.jQuery is a good idea. The reason for getting rid of it was that it interfered with other jQuerys on the page. |
Upon funcunit import, we get... "
VM180:9958 Uncaught ReferenceError: jQuery is not defined
at :9958:21
at global.define (:73:36)
at :9955:1
(anonymous) @ VM180:9958
global.define @ VM180:73
(anonymous) @ VM180:9955
"
This could be a regression of #187 (similar syndrome), but I think jQuery is undefined prior to the failure moment described in 187.
Chasen suspects it might be related to changeset: #230
... and I think he's on to something.
The text was updated successfully, but these errors were encountered: