You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After building my project with require-globify and factor-bundle I get the following exception in the browser:
a.js:6 Uncaught TypeError: Cannot read property '0' of undefined
at Object.require.4.dup (file:///home/futpib/tmp/require-globify-factor-bundle-issue-demo/dist/a.js:6:16)
at s (file:///home/futpib/tmp/require-globify-factor-bundle-issue-demo/dist/a.js:1:262)
at file:///home/futpib/tmp/require-globify-factor-bundle-issue-demo/dist/a.js:1:313
at Object.require.3../lib/util.js (file:///home/futpib/tmp/require-globify-factor-bundle-issue-demo/dist/a.js:2:27)
at s (file:///home/futpib/tmp/require-globify-factor-bundle-issue-demo/dist/a.js:1:262)
at e (file:///home/futpib/tmp/require-globify-factor-bundle-issue-demo/dist/a.js:1:433)
at file:///home/futpib/tmp/require-globify-factor-bundle-issue-demo/dist/a.js:1:451
Note that naming of the src/* subdirectories is somehow significant (a and a-b). If I rename a-b to b or ab I am no longer able to reproduce this. (no idea)
Also, identical contents of src/a/lib/util.js and src/a-b/lib/util.js seems to be significant (they don't have to be empty, but they have to be identical, for this issue to reproduce). This makes me thing this may be related to dedupe part of browserify pipeline, but I'm not yet that deep into the whole build process to figure this one out for sure.
Workaround: don't glob-require identical files within directories that are prefixes of one another :).
I know this is a very specific edge case that no one probably cares about, I hope to at least get some pointers to what this could be related to.
The text was updated successfully, but these errors were encountered:
futpib
changed the title
Issue when used with factor-bundle with somewhat specific source files layout
Exception when used with factor-bundle with somewhat specific source files layout
Oct 27, 2016
After building my project with require-globify and factor-bundle I get the following exception in the browser:
Steps to reproduce:
npm install
node index.js
xdg-open index.html
or open index.html in your browserI tried to come up with a shorter executable example, but this is the simplest I could get.
Here is the compiled code that leads to exception (prettified by chrome's debugger):
Note that naming of the
src/*
subdirectories is somehow significant (a
anda-b
). If I renamea-b
tob
orab
I am no longer able to reproduce this. (no idea)Also, identical contents of
src/a/lib/util.js
andsrc/a-b/lib/util.js
seems to be significant (they don't have to be empty, but they have to be identical, for this issue to reproduce). This makes me thing this may be related todedupe
part of browserify pipeline, but I'm not yet that deep into the whole build process to figure this one out for sure.Workaround: don't glob-require identical files within directories that are prefixes of one another :).
I know this is a very specific edge case that no one probably cares about, I hope to at least get some pointers to what this could be related to.
The text was updated successfully, but these errors were encountered: