Closed panzerdp closed 9 years ago
@panzerdp It's probably not really anything intrinsic to pathmodify. Can you show me the relevant code from your gulpfile? You're not calling b.plugin()
in your update
handler by chance, are you?
@jmm
You're right, the problem was in calling watch.plugin(pathmodify, options)
in update
callback.
Thanks four your help!
@jmm Probably it would be good to add a verification when plugin is attaching multiple times on the same watchify / browserify instance. Sometimes these kind of errors are hard to see :).
@panzerdp You're welcome.
I'll think over your suggestion. It's also fairly common for people to do that with transforms where that kind of state doesn't exist (the transform doesn't receive the browserify instance) and it results in multiple passes of the same transform running on each bundle.
@jmm
After some evaluation on the issue, I think it doesn't make sense to add this verification. This will break the possibility to add many pathmodify instances with different options on the same watchify/browserify.
The current warning: possible EventEmitter memory leak detected
should be enough for understanding the problem.
Thank you.
@panzerdp Ok, thanks for the feedback. If that warning arises from unintentionally calling b.plugin()
in the update handler it's probably better overall not to squelch it as it could mask other problems -- like calling b.transform()
there.
When using pathmodify on multiple bundles with watchify, sometimes I receive this error:
Is it something on the pathmodify side?
Thanks.