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

-r seems to break it? #20

Open
mattdesl opened this issue Aug 15, 2014 · 11 comments
Open

-r seems to break it? #20

mattdesl opened this issue Aug 15, 2014 · 11 comments

Comments

@mattdesl
Copy link

With -r ./foo/bar:foo option to browserify, I'm getting this error:

/usr/local/lib/node_modules/disc/bin/discify:59
    if (err) throw err
                   ^
Error: Unable to compile one of the supplied bundles!
    at /usr/local/lib/node_modules/disc/index.js:47:56
    at Array.map (native)
    at json (/usr/local/lib/node_modules/disc/index.js:46:5)
    at Function.bundle (/usr/local/lib/node_modules/disc/index.js:128:10)
    at handle (/usr/local/lib/node_modules/disc/bin/discify:56:8)
    at BufferList.disc.bundle.mode [as _callback] (/usr/local/lib/node_modules/disc/bin/discify:45:5)
    at BufferList.end (/usr/local/lib/node_modules/disc/node_modules/bl/bl.js:75:10)
    at Socket.onend (stream.js:79:10)
    at Socket.emit (events.js:117:20)
    at _stream_readable.js:929:16

Will try to look into it further..

EDIT: Seems related to browser-unpack; the latest version 1.0.0 fixes the problem but introduces another:

/projects/disc/node_modules/commondir/index.js:15
            throw new Error('relative path without a basedir');
                  ^
Error: relative path without a basedir
    at /projects/disc/node_modules/commondir/index.js:15:19
    at Array.reduce (native)
    at module.exports (/projects/disc/node_modules/commondir/index.js:13:30)
    at json (/projects/disc/index.js:70:14)
    at Function.bundle (/projects/disc/index.js:128:10)
    at handle (/projects/disc/bin/discify:56:8)
    at BufferList.disc.bundle.mode [as _callback] (/projects/disc/bin/discify:45:5)
    at BufferList.end (/projects/disc/node_modules/bl/bl.js:75:10)
    at Socket.onend (stream.js:79:10)
    at Socket.emit (events.js:117:20)

Using a full path for my -r option doesn't fix the issue.

@hughsk
Copy link
Owner

hughsk commented Aug 15, 2014

Interesting - I recognise both these errors, will look into it shortly and let you know :)

@mattdesl
Copy link
Author

cool.. no rush, i hacked a fix by ignoring the problematic modules

@hughsk
Copy link
Owner

hughsk commented Aug 15, 2014

Cool – do you have a test case I can break it with?

@mattdesl
Copy link
Author

Unfortunately the code is private. I'll see if I can replicate it tho

Sent from my iPhone

On Aug 15, 2014, at 4:18 PM, Hugh Kennedy [email protected] wrote:

Cool – do you have a test case I can break it with?


Reply to this email directly or view it on GitHub.

@jkimbo
Copy link

jkimbo commented Oct 13, 2014

Getting the same error unfortunately. @mattdesl did you get around to reproducing the problem?

@mattdesl
Copy link
Author

I was able to reproduce it on a private repo. Basically this was breaking it:

browserify -r app/foo:foo

Where "foo" was a module that had its own package and index.js.

If I remember correctly, I lazily fixed it by doing npm link app/foo which symlinked it into the node_modules dir. Once the module could be required without the -r option, it seemed to work.

Sent from my iPhone

On Oct 13, 2014, at 6:21 PM, Jonathan Kim [email protected] wrote:

Getting the same error unfortunately. @mattdesl did you get around to reproducing the problem?


Reply to this email directly or view it on GitHub.

@nnarhinen
Copy link

this also seems to happen if you have custom NODE_PATH like NODE_PATH=$NODE_PATH:lib/ and in your app you require like require('ding/dong') where dong.js is in lib/ding/dong.js

@jackwanders
Copy link

Thought I'd add that this appears to continue to be an issue. I get the same error when creating a 'vendor' bundle that consists solely of --require'd modules, e.g.

$ browserify -r foo -r bar -r baz --full-paths > vendor.js

@joews
Copy link

joews commented Jun 2, 2015

I'm getting the same issue with --require -only bundles.

@domarmstrong
Copy link

+1 cant compile with --require

@SystemParadox
Copy link
Contributor

See also #41. Should be fixed by #45.

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

8 participants