Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: this.emit is not a function #4

Closed
ghost opened this issue Aug 13, 2019 · 2 comments · Fixed by #5
Closed

TypeError: this.emit is not a function #4

ghost opened this issue Aug 13, 2019 · 2 comments · Fixed by #5

Comments

@ghost
Copy link

ghost commented Aug 13, 2019

When the plugin encounters an error in my javascript code, it logs the error, but this is followed by a TypeError that breaks my gulp watch script.

It seems that the "this" context in the printError function no longers refers to the gulp stream.

Platform: Windows
Error:
D:..\node_modules\gulp-terser-js\index.js:82
return this.emit('end');
^

TypeError: this.emit is not a function
at printError (D:..\node_modules\gulp-terser-js\index.js:82:14)
at DestroyableTransform._transform (D:..\node_modules\gulp-terser-js\index.js:40:7)
at DestroyableTransform.Transform._read (D:..\node_modules\readable-stream\lib_stream_transform.js:184:10)
at DestroyableTransform.Transform._write (D:..\node_modules\readable-stream\lib_stream_transform.js:172:83)
at doWrite (D:..\node_modules\readable-stream\lib_stream_writable.js:428:64)
at writeOrBuffer (D:..\node_modules\readable-stream\lib_stream_writable.js:417:5)
at DestroyableTransform.Writable.write (D:..\node_modules\readable-stream\lib_stream_writable.js:334:11)
at DestroyableTransform.ondata (D:..\node_modules\readable-stream\lib_stream_readable.js:619:20)
at DestroyableTransform.emit (events.js:182:13)
at DestroyableTransform.EventEmitter.emit (domain.js:459:23)

@A-312
Copy link
Member

A-312 commented Aug 13, 2019

I am making a fix

@A-312
Copy link
Member

A-312 commented Aug 13, 2019

Done :)

@Tehren Thanks for this report ! :)

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 a pull request may close this issue.

1 participant