ForbesLindesay / browserify-middleware

express middleware for browserify, done right
http://browserify.org
MIT License
381 stars 66 forks source link

why is that package not working : #54

Closed daslicht closed 10 years ago

daslicht commented 10 years ago

https://github.com/agilemd/objectid/blob/master/index.js

? When I try to require this package I just get a 500

any idea?

ForbesLindesay commented 10 years ago

What's the error that goes with that 500? Check the console, and the text that appears in your browser when you attempt to load that file.

daslicht commented 10 years ago

i haven't seen any further infos there :/ I keep trying or try to find an alternative lib, thank you !

ForbesLindesay commented 10 years ago

Attempting to browserify it on windows I get:

Error: module "./win32/x64/bson" not found from "C:\\Users\\forbes.lindesay\\Documents\\GitHub\\!temp\\node_modules\\objectid\\node_modules\\bson\\ext\\index.js"
ForbesLindesay commented 10 years ago

It looks like ObjectID is depending on an old version of bson (0.1.9). In order for bson to support browserify, you must use bson V0.2.5 or greater.

daslicht commented 10 years ago

Hm I just get this in my browser console:

GET http://localhost:3000/js/jsentry.js 500 (Internal Server Error) 

here is my jsentry :

var objectid = require('objectid');

and I am using it like this:

app.use('/js/jsentry.js', browserify('./jsentry.js'));

But I dont get any error in my server console ?

Where do you see that error , please?

ForbesLindesay commented 10 years ago

I get it when I use the browserify command line. Try opening http://localhost:3000/js/jsentry.js in your web browser? Browserify-middleware will just forward the error to whatever express error handling you have, so it's possible you're silencing the errors in there.

daslicht commented 10 years ago

aha ! In the browser the error is shown correcly : Error: module "./win32/x64/bson" not found from "/Users/daslicht/node/e4hbs/node_modules/objectid/node_modules/bson/ext/index.js"

thank you !

ForbesLindesay commented 10 years ago

no problem. It's frustrating that the browser doesn't show the error in its console.