firebase/geofire-js

Typeof process Why is GeoFire only exported when running in Node

Closed this issue · 5 comments

I'd like to use GeoFire in my mobile project created with Fusetools

It's not clear to me why typeof process !== "undefined" is included.

// Export GeoFire if this is being run in node
if (typeof module !== "undefined" && typeof process !== "undefined") {
  module.exports = GeoFire;
}

Or in other words, what will go wrong if I export GeoFire module without process being defined.

Thanks!

Wondering the same thing. I'm trying to use in an Angular 6 project and process is undefined

Same problem, some solution? Thanks for the effort

@Hugoer Here is what I did...

node_modules/geofire/dist/geofire.js (1223)

Move export outside of if statement because process is undefined

// Export GeoFire if this is being run in node
if (typeof module !== "undefined" && typeof process !== "undefined") {
}
module.exports = GeoFire; // *** Move this line out of if statement

Tranks @doovers ! Yes, something like this I did now to test it, I'll do a gulp task to always add that line at the end, to try to modify the files of node_modules as little as possible

puf commented

cleaning up some old issues

It looks like this issue was resolved by @doovers' comment. If there's anything we can do in this repo to improve matters, without breaking devs on other platforms, please reopen the issue and open a PR.