Closed micah-bloomerang closed 8 years ago
+1 I'm getting a similar issue
@djforth any differences in your issue? Maybe we can find a common thread.
This seems related to https://github.com/substack/factor-bundle/issues/51
Hi Sorry for the late reply, I think my issue was 2 fold. Firstly my common bundle seemed to loading after my other bundles because of async and secondly it was a dependancy mismatch. Once I had sorted it so that my internal modules where all the same + using peerDependancy over dependancy in the modules the issue seemed to disappear. Hope that helps.
I'm having the exact same issue and I am quite, quite desperate now. It took me three days to narrow it down to factor-bundle... apparently, if I require more than one module twice with Browserify, I'm also getting the following error:
TypeError: Cannot read property '0' of undefined
If I duplicate a module and give it a different name, everything works as expected. This was working fine until I recently updated React and Babel to their latest versions (React 0.13 and Babel 5.x were working fine). Any leads?
@djforth Could you please give me some more details about your dependency mismatch? How did you narrow them down to the root cause?
This might be related to the problem in browser-pack
that browserify entries are required before the require
method is exposed to the global scope. When you are using multiple bundles browserify depends on a global require
variable.
I've got an open pull request fixing that (https://github.com/substack/browser-pack/pull/73), but it has no response yet.
I was only seeing this issue in lodash v3 (was using v3.10.1), but after upgrading lodash to v4 (v4.6.1), I no longer see the issue. Closing.
I've been working on this problem for a couple of days, and I think I finally have it narrowed down. If I'm using factor-bundle where one file contains a reference to lodash and the other file contains a reference to react-bootstrap, I get the following error:
Here is what is needed to reproduce:
index.html
main/index.js
main/bad.js
Build with: