Thuzi / facebook-node-sdk

Modeled from the (Facebook Javascript SDK), now with the facebook-node-sdk you can now easily write the same code and share between your server (nodejs) and the client (Facebook Javascript SDK).
Other
736 stars 250 forks source link

facebook-node-sdk with browserify #80

Open plus- opened 9 years ago

plus- commented 9 years ago

Is this suppose to work out of the box?

I'd like to replace my fb sdk async call with this & browserify, but I get a node_modules error on the client side.

I'm just asking before digging further.

cmwelsh commented 9 years ago

This does not appear to be a supported use case. Consider adding proxy routes to your server-side application to provide the necessary data to the browser.

jakemmarsh commented 9 years ago

Also looking to use this sdk with Browserify, and currently getting the same node_moduels error.

Is there any way to shim or modify it to work with Browserify?

cmwelsh commented 9 years ago

This is a server side library. I don't think the author intended it to be used in browsers - forgive me if I'm wrong.

jakemmarsh commented 9 years ago

Well, I'm using it in a node-webkit app. Not explicitly being run in the browser.

dantman commented 8 years ago

The fix will probably be to change this:

version = require(require('path').resolve(__dirname, 'package.json')).version

To this:

version = require('./package.json').version
dantman commented 8 years ago

I've made this change in this commit. It will end up in the next release.