Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

beefy crashes if used as a module with watchify #51

Open
mikolalysenko opened this issue Jun 24, 2014 · 2 comments
Open

beefy crashes if used as a module with watchify #51

mikolalysenko opened this issue Jun 24, 2014 · 2 comments

Comments

@mikolalysenko
Copy link

In beefy 2.0.1, running with watchify 0.10.2 doesn't work. For example, in glslify-workshopper I get the following message if I run with watchify installed:

/Users/mikolalysenko/GitHub/glslify-workshopper/node_modules/beefy/lib/bundlers/watchify.js:45
      return watchifies[entryPath]()
                                  ^
TypeError: Property '/Users/mikolalysenko/GitHub/glslify-workshopper/menu/index.js' of object #<Object> is not a function
    at Object.handlePath [as command] (/Users/mikolalysenko/GitHub/glslify-workshopper/node_modules/beefy/lib/bundlers/watchify.js:45:35)
    at handle (/Users/mikolalysenko/GitHub/glslify-workshopper/node_modules/beefy/lib/handlers/bundle.js:48:27)
    at handle (/Users/mikolalysenko/GitHub/glslify-workshopper/node_modules/beefy/lib/handlers/log.js:42:5)
    at beefyMainHandler (/Users/mikolalysenko/GitHub/glslify-workshopper/node_modules/beefy/lib/create-handler.js:42:12)
    at handler (/Users/mikolalysenko/GitHub/glslify-workshopper/node_modules/beefy/index.js:77:5)
    at Server.<anonymous> (/Users/mikolalysenko/GitHub/glslify-workshopper/index.js:88:14)
    at Server.EventEmitter.emit (events.js:98:17)
    at HTTPParser.parser.onIncoming (http.js:2108:12)
    at HTTPParser.parserOnHeadersComplete [as onHeadersComplete] (http.js:121:23)
    at Socket.socket.ondata (http.js:1
npm ERR! glslify-workshopper@0.0.0 start: `mkdir answers; cd answers && NODE_ENV=development node ..`
npm ERR! Exit status 8
npm ERR!
npm ERR! Failed at the glslify-workshopper@0.0.0 start script.
npm ERR! This is most likely a problem with the glslify-workshopper package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     mkdir answers; cd answers && NODE_ENV=development node ..
npm ERR! You can get their info via:
npm ERR!     npm owner ls glslify-workshopper
npm ERR! There is likely additional logging output above.
npm ERR! System Darwin 13.1.0
npm ERR! command "node" "/usr/local/bin/npm" "start"
npm ERR! cwd /Users/mikolalysenko/GitHub/glslify-workshopper
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/mikolalysenko/GitHub/glslify-workshopper/npm-debug.log
npm ERR! not ok code 0

I think it might be better long term to pin beefy to a specific version of watchify, rather than letting this float. Even though these projects are relatively well maintained it is possible for watchify/browserify to introduce breaking changes and locking to a specific version via semantic versioning seems like a better solution going forward.

@chrisdickinson
Copy link
Owner

Found out where the problem is -- there's actually two things going on:

  1. Beefy prefers watchify if it is locally available. That means that if someone has watchify in a node_modules dir anywhere up from their current working directory, it'll try to use it. If the workshopper is globally installed, and watchify is globally installed, this means it will try to use the globally installed watchify (since it's in a node_modules directory up from the file's location).
  2. Beefy is making a huge mistake with regards to parsing options. Fixing that part now. Once this is fixed it should work with watchify.

@chrisdickinson chrisdickinson changed the title beefy crashes if watchify is installed beefy crashes if used as a module with watchify Jun 25, 2014
@wmayner
Copy link

wmayner commented Sep 12, 2014

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants