Closed terinjokes closed 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.
+1
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)
How about a simple app showing the problem? https://github.com/jerryorr/factor-bundle-issue-13
It would indeed
Any news on this issue?
I'm rewriting this to work with browserify's int map
+1
Glad I found this thread, it's not just me going crazy!
+1. any known workarounds?
Fixed in 1.0.0.
Sweet!
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.
I'm not using
b.require
,b.external
and all transforms are in my package.json file.