You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Backbone associations can not be used in a browserify stack as both the window and exports modules are defined as objects at runtime on the clientside. For this reason, the require('backbone') etc calls are not made and so instead it assigns Backbone and _ to exports._ and exports.Backbone, which are by definition, empty. Presumably that branch of the if logic should only fire when root == window and never root == exports as it does now in a browserify environment.
(typeof exports === "object") instead of (typeof window === "undefined") resolves the issue. Basically the key is to give priority to checking exports over window first.
One way I've seen which seems to cover all the bases is:
Thanks @adamscybot for pointing this out. I have just pushed code to check exports over window as per your code snippet. Let me know if it works for you.
Works correctly, thanks. I think the .min version needs updating though. Also a minor version push to NPM would be useful so I can stop pulling this repo directly in my package.json :).
Backbone associations can not be used in a browserify stack as both the window and exports modules are defined as objects at runtime on the clientside. For this reason, the require('backbone') etc calls are not made and so instead it assigns Backbone and _ to exports._ and exports.Backbone, which are by definition, empty. Presumably that branch of the if logic should only fire when root == window and never root == exports as it does now in a browserify environment.
(typeof exports === "object")
instead of(typeof window === "undefined")
resolves the issue. Basically the key is to give priority to checking exports over window first.One way I've seen which seems to cover all the bases is:
The text was updated successfully, but these errors were encountered: