Closed erykpiast closed 9 years ago
ACK this. It seems to be very prominent when mixing browserify 8.x.y
and browserify 7.x.y
. watchify is using browserify 7.x.y.
Interesting! I missed that I use not compatible versions. Shouldn't be Browserify a peerDependency of Watchify? To raise alarm in case like that etc.?
@erykpiast I would think so. Alas, in the mean time, I just removed browserify
from my ./node_modules/watchify/node_modules/
directory and moved on.
It's not used anyway when you call watchify function from node, as far as I understand the code. So, how removing files can help? I'm just wondering.
I use ./node_modules/.bin/watchify/
with a few transforms.
Ok, it makes sense!
2015-01-30 17:01 GMT+01:00 Daniel Cousens notifications@github.com:
I use ./node_modules/.bin/watchify/ with a few transforms.
— Reply to this email directly or view it on GitHub https://github.com/substack/watchify/issues/128#issuecomment-72223330.
You shouldn't mix versions like that. Although watchify lists browserify as a dependency (not peer dependency), watchify is usually updated shortly after browserify to reflect major version updates. If you have both watchify and browserify listed as dependencies with overlapping semver versions, then npm will dedupe browserify out of watchify.
I found quite interesting problem specific for watchify (browserify works OK) when I directly use some NPM package used by some other package as a dependency. For example if dependency graph looks like
(sorry for lack of arrows, but I'm not ASCII art master; it's not circular dependency)
every build after initial one causes returning
undefined
from module A. You can check it in my repo, where I found the issue - https://github.com/erykpiast/online-css-autoprefixer/tree/f1cb86544dd1401453456e620e2687e8fecfc681. Clone it, checkout to revisionf1cb865
and runnpm instal && gulp
after that. When you change something and trigger rebuild, you will see that modulecaniuse-db/data
returnsundefined
.