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

Builds never exits AND emitter.prependListener is not a function is thrown #481

Closed
tildebyte opened this issue Oct 21, 2016 · 14 comments
Closed
Labels

Comments

@tildebyte
Copy link

Since #438 and #441 have been closed, but this issue persists and involves both...

Win 10 x64, atom 1.12.0-beta3

I've uninstalled sync-settings and atom-beautify and restarted atom, and I'm still getting the Failed to build: emitter.prependListener is not a function error message when building. I don't find emitter.prependListener being referenced in any other package which I have installed[1].

The build "works" with an .atom-build.yml which contains only cmd: echo Hello world in the root of the project (i.e. prints Hello world), but runs indefinitely after that, and I have to restart atom to attempt to build again.

No errors in the console. Nothing in the console, actually.

[1] There may be an atom core package which pulls in emitter.prependListener in some way, but I don't have the time to grep through all of their sources (although I did search atom itself).

@hultberg
Copy link

hultberg commented Oct 24, 2016

Same issue here. However, I do not have sync-settings, nor atom-beautify installed.

apm  1.13.0
npm  3.10.5
node 4.4.5
python 2.7.12
git 2.10.1

@noseglid
Copy link
Owner

I'm sorry to say I have no idea what this is or where it comes from.

I've just published version v0.66.0. It should include a stacktrace in that error message when you get it. Could either of you supply a screenshot of that stack?

@boxama
Copy link

boxama commented Oct 24, 2016

I'm also having this error.
I just updated and managed to catch a stack trace (the notification only gives you a few seconds to do so)

Failed to build.
emitter.prependListener is not a function
Hide Stack Trace
TypeError: emitter.prependListener is not a function
    at prependListener (_stream_readable.js:19:20)
    at Socket.Readable.pipe (_stream_readable.js:584:3)
    at /home/user/.atom/packages/build/lib/build.js:170:25

@noseglid
Copy link
Owner

Great @boxama . This sheds some light.

The code in question is when build is trying to pipe all output data to the view.

Something goes wrong inside the core lib... i'm not sure why. It's almost certainly not an issue with atom-build itself.

Not sure why it only happens to some either...

@tildebyte
Copy link
Author

Yeah, I wondered about that... I tested with a job which I knew would definitely error out, but got no output at all frombuild

@hultberg
Copy link

hultberg commented Oct 26, 2016

Even though it might not be an issue directly with this package, it certainly makes it useless. Do you have any idea where to start debugging, would like to make this package work.

@noseglid
Copy link
Owner

It's difficult since I never get the error and have no way of reproducing..

Could you try adding something like this.terminal.prependListener = () => { console.log('listener prepended') } at https://github.com/noseglid/atom-build/blob/master/lib/build-view.js#L45, then check the logs and see if you get the 'listener prepended' message. This is my best theory at the moment and this could verify/discredit that.

@noseglid noseglid added the bug label Oct 26, 2016
@boxama
Copy link

boxama commented Oct 26, 2016

Actually, adding the prependListener method fixes the problem.
Perhaps it should be added as a fix until this is ideally fixed upstream? I'm not sure if it's been reported before but a fix hasn't been released yet.

@noseglid
Copy link
Owner

That's good. My theory is correct then.

As a work around right now I think a good course of action is to implement it using the addListener. Sure, it will be at the end of the event list rather than at the beginning, but hopefully it wont cause any issues.

As a long term solution, the terminal package should be replaced with something more maintained.
Such discussions are ongoing

@hultberg
Copy link

hultberg commented Oct 28, 2016

@noseglid That did it for me too, thanks for the quickfix!

@noseglid
Copy link
Owner

Cool. I'll try and get a workaround in soon and release it. Thanks for reports and help debugging.

@kelexel
Copy link

kelexel commented Nov 10, 2016

I had the same issue, it happened after I disabled, than later, re-enabled all platformio and build packages.
I can confirm the above fix is working for me.
Thank you !!! :)

@nbJosh
Copy link

nbJosh commented Nov 10, 2016

Just lost the ability to build. happened after updating packages in atom.

Above fix working.

@noseglid
Copy link
Owner

v0.67.0 released with this fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants