max-mapper / requirebin

write browser JavaScript programs using modules from NPM
requirebin.com
391 stars 80 forks source link

error #0 when requiring npm module #86

Closed mheiber closed 6 years ago

mheiber commented 9 years ago

I'm getting error #0 when trying to require an npm module that I made which works fine on Node:

var Tabs=require('react-tabs-component');

Can you recommend a way to fix my module so it will work with requirebin? requirebin is so awesome and I would love to be able to demo the module using it.

I'm attaching a screenshot and pasting full error message below.

screen shot 2015-03-22 at 10 55 14 pm

Bundling error:

---FLAGRANT SYSTEM ERROR---

--- error #0: ---

(logs uuid: 000b94a0-d108-11e4-9e4d-4b4dd82dfefe )

Error: "browserify exited with code 1"

code: 1 stderr: Error: Cannot find module 'reactify' from '/tmp/react-tabs-component115223-30353-h6lq8y/node_modules/react-tabs-component' at /home/admin/browserify-cdn/node_modules/browserify/node_modules/resolve/lib/async.js:50:17 at process (/home/admin/browserify-cdn/node_modules/browserify/node_modules/resolve/lib/async.js:119:43) at /home/admin/browserify-cdn/node_modules/browserify/node_modules/resolve/lib/async.js:128:21 at load (/home/admin/browserify-cdn/node_modules/browserify/node_modules/resolve/lib/async.js:60:43) at /home/admin/browserify-cdn/node_modules/browserify/node_modules/resolve/lib/async.js:66:22 at /home/admin/browserify-cdn/node_modules/browserify/node_modules/resolve/lib/async.js:21:47 at Object.oncomplete (fs.js:107:15)

dirPath: /tmp/react-tabs-component115223-30353-h6lq8y


This is probably an issue with the package, and not browserify-cdn itself. If you feel differently, feel free to file a bug report at:

https://github.com/jesusabdullah/browserify-cdn/issues

Include the ENTIRETY of the contents of this message, and he can try to help you out.

Have a nice day!

mauriciopoppe commented 9 years ago

requirebin uses https://github.com/jfhbrook/browserify-cdn to create a browserify bundle and unfortunately the bundling process doesn't allow hooking transforms (you're trying to use the reactify transform)

max-mapper commented 9 years ago

@maurizzzio actually browserify-cdn does run transforms if they are in package.json. @mheiber just didn't add reactify to dependencies here https://github.com/mheiber/react-tabs-component/blob/3088723c4c8ae0aeff9322f1f16489ead921907b/package.json#L17

mauriciopoppe commented 9 years ago

I see, sorry for misleading