browserify / factor-bundle

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

When used as a plugin, depedencies are sometimes resolved to the wrong 'int' #13

Closed terinjokes closed 10 years ago

terinjokes commented 10 years ago

I'm not using b.require, b.external and all transforms are in my package.json file.

andornaut commented 10 years ago

I'm also experiencing a similar issue: dependencies are resolved in the wrong order. For instance, require('./foo') will yield bar instead, and similarly for other dependencies. Though in my case, I'm not using transforms at all.

Browserify itself works great, though my attempt to convert one app from requirejs is currently blocked on this issue.

jerryorr commented 10 years ago

+1

terinjokes commented 10 years ago

I have it as a ticket on my (internal) sprint to create a failing test case, and, if possible, solve this. But if anyone already has a simple one, that would be great. (So far I can only reproduce when building a large application)

jerryorr commented 10 years ago

How about a simple app showing the problem? https://github.com/jerryorr/factor-bundle-issue-13

terinjokes commented 10 years ago

It would indeed

madebyherzblut commented 10 years ago

Any news on this issue?

terinjokes commented 10 years ago

I'm rewriting this to work with browserify's int map

justrhysism commented 10 years ago

+1

Glad I found this thread, it's not just me going crazy!

sixtimes commented 10 years ago

+1. any known workarounds?

ghost commented 10 years ago

Fixed in 1.0.0.

justrhysism commented 10 years ago

Sweet!

justrhysism commented 10 years ago

I've upgraded and am on the latest version of browserify and factor-bundle and I am getting an error when trying to compile:

C:\Projects\Client\pcu005-develop\Fusion.FrontEnd\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 (C:\Projects\Client\pcu005-develop\Fusion.FrontEnd\node_modules\factor-bundle\node_modules\deps-topo-sort\index.js:28:21)
    at Array.forEach (native)
    at visit (C:\Projects\Client\pcu005-develop\Fusion.FrontEnd\node_modules\factor-bundle\node_modules\deps-topo-sort\index.js:33:16)
    at Array.forEach (native)
    at Stream.<anonymous> (C:\Projects\Client\pcu005-develop\Fusion.FrontEnd\node_modules\factor-bundle\node_modules\deps-topo-sort\index.js:38:21)
    at _end (C:\Projects\Client\pcu005-develop\Fusion.FrontEnd\node_modules\factor-bundle\node_modules\through\index.js:65:9)
    at Stream.stream.end (C:\Projects\Client\pcu005-develop\Fusion.FrontEnd\node_modules\factor-bundle\node_modules\through\index.js:74:5)
    at Stream.method [as end] (C:\Projects\Client\pcu005-develop\Fusion.FrontEnd\node_modules\factor-bundle\node_modules\stream-combiner\node_modules\duplexer\index.js:47:39)
    at Transform.onend (C:\Projects\Client\pcu005-develop\Fusion.FrontEnd\node_modules\browserify\node_modules\readable-stream\lib\_stream_readable.js:530:10)
    at Transform.g (events.js:180:16)

I tried digging into it, and so far as I could tell, when deps-topo-sort was trying to arrange the dependency graph, it would be missing various indexes. I have a simple test with two files, one depending on jQuery, and I got the same error. I will try a blank test case again, but it seems as though deps-topo-sort isn't being passed everything correctly... or something.

Sorry I couldn't be of much more help - I'm a little out of my depth here.