browserify / factor-bundle

factor browser-pack bundles into common shared bundles
Other
400 stars 27 forks source link

Cannot factor when using exposed names. #33

Closed Pita closed 10 years ago

Pita commented 10 years ago

I produced a test case here: https://github.com/Pita/repro-factor-bug to reproduce it, run: npm install; node build.js

Thats the error message I get:

$ node build.js 

/home/pita/Code/test/node_modules/factor-bundle/node_modules/deps-topo-sort/index.js:28
        if (seen[mod.id]) return;
                    ^
TypeError: Cannot read property 'id' of undefined
    at visit (/home/pita/Code/test/node_modules/factor-bundle/node_modules/deps-topo-sort/index.js:28:21)
    at Array.forEach (native)
    at visit (/home/pita/Code/test/node_modules/factor-bundle/node_modules/deps-topo-sort/index.js:33:16)
    at Array.forEach (native)
    at Stream.<anonymous> (/home/pita/Code/test/node_modules/factor-bundle/node_modules/deps-topo-sort/index.js:38:21)
    at _end (/home/pita/Code/test/node_modules/factor-bundle/node_modules/deps-topo-sort/node_modules/through/index.js:65:9)
    at Stream.stream.end (/home/pita/Code/test/node_modules/factor-bundle/node_modules/deps-topo-sort/node_modules/through/index.js:74:5)
    at Stream.method [as end] (/home/pita/Code/test/node_modules/factor-bundle/node_modules/stream-combiner/node_modules/duplexer/index.js:47:39)
    at Readable.end (/home/pita/Code/test/node_modules/browserify/node_modules/labeled-stream-splicer/node_modules/stream-splicer/node_modules/readable-wrap/index.js:52:31)
    at Labeled.<anonymous> (/home/pita/Code/test/node_modules/browserify/node_modules/labeled-stream-splicer/node_modules/stream-splicer/index.js:45:26)
terinjokes commented 10 years ago

Aside: there's no Browserify option files. This needs to be browserify(['a.js']).

Attempting to fix upstream.

terinjokes commented 10 years ago

@Pita can you try my branch and confirm it works?

Pita commented 10 years ago

Yes it works! Thanks so much! And yes I used the wrong syntax, guess I copy pasted it from somewhere, but can't remember.

Pita commented 10 years ago

Can we bump the factor-bundle version?

terinjokes commented 10 years ago

Yeah, I'll do a release after this next meeting.