browserify / wzrd.in

browserify as a service.
http://wzrd.in
MIT License
639 stars 96 forks source link

issues involving libraries that use request and/or the dns module #21

Open jfhbrook opened 11 years ago

jfhbrook commented 11 years ago

https://gist.github.com/maxogden/d3353cfaa66eabe5d18c https://friendpaste.com/4hvzoL2l8p8kQjoyQidU3G

Also interesting is that it happily spat out 80% of the code. Perhaps the error messages shouldn't include the bundled stdout? Unsure.

jfhbrook commented 11 years ago

Okay, so I tracked it down.

When I run a "singular" bundle locally, I get:

browserify-cdn ERR!  stderr: Error: module "dns" not found from "/tmp/gs2geojson11365-17194-1h0lixi/node_modules/gs2geojson/node_modules/tabletop/node_modules/request/node_modules/hawk/node_modules/sntp/lib/index.js"

browserify-cdn ERR!  dirPath: /tmp/gs2geojson11365-17194-1h0lixi

basically, what happens is the dep tree goes gs2geojson->tabletop->request->hawk->sntp->{core dns module}, and that explodes, presumably because browserify doesn't shim out dns by default.

I see a few ways to go here:

  1. Convince browserify to use some kind of dns shim (how??)
  2. Convince browserify to use browser-request instead of request (how?)
  3. Shrug our shoulders and say, "too bad lol"

As far as more useful debugging output for the user:

  1. Expose the npm deps tree
  2. Don't include browserified output if there's an error
jfhbrook commented 11 years ago

/cc @maxogden