Skip to content

Conversation

@darwin
Copy link

@darwin darwin commented Mar 17, 2014

Shim config gets mutated when shim transformation is called.
Multiple invocations cause single file to be wrapped multiple times,
which breaks the wrapping functionality and leads to very cryptic javascript errors.

This problem gets exposed for example using shims together with file watching.
https://github.com/FrenkyNet/gulp-browserify-bug-62/blob/master/gulpfile.js

Shim config gets mutated when shim transformation is called.
Multiple invocations cause single file to be wrapped multiple times,
which breaks the wrapping functionality and leads to very cryptic javascript errors.

This problem gets exposed for example using shims together with file watching.
https://github.com/FrenkyNet/gulp-browserify-bug-62/blob/master/gulpfile.js
@deepak1556
Copy link
Owner

Thanks, But doesnt seem to fix the problem. Any suggestions ?

@darwin
Copy link
Author

darwin commented Mar 19, 2014

Well, maybe we both speak about different problem :) This definitely fixed the issues in my case of using gulp watcher with gulp-browserify, which had config passed as a separate pre-constructed object (now I see it does not match the linked example), so maybe there are more separate bugs.

My bug was caused by you modifying opts object every time browserify is called. If I always construct config object from scratch it works, but when I pass existing object and reuse it between invocations it breaks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants