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

dest.end is not a function #20

Open
femiveys opened this issue Dec 29, 2020 · 13 comments · May be fixed by #103
Open

dest.end is not a function #20

femiveys opened this issue Dec 29, 2020 · 13 comments · May be fixed by #103
Assignees
Labels
bug Something isn't working

Comments

@femiveys
Copy link

femiveys commented Dec 29, 2020

I used to use the kill-port module for this functionality but it didn't have types for TypeScript, so I switched to this module.
However, now I get an ugly error:

dest.end is not a function

This is my simplified code:

import { killPortProcess } from 'kill-port-process';

export const startApiServer = async () => {
  await killPortProcess(8000);
  ...
}
...
startApiServer()

This makes this module unusable for me.

I have tried it with node 10 and 12

@hilleer
Copy link
Owner

hilleer commented Dec 29, 2020

Hi @femiveys ,

Thanks for opening this issue and sorry for the problem you are experiencing.

What platform are you on? Window, Mac or Linux?

@femiveys
Copy link
Author

I am on OSX Catalina 10.15.7

@hilleer hilleer added the bug Something isn't working label Jan 15, 2021
@hilleer
Copy link
Owner

hilleer commented Feb 1, 2021

Hi @femiveys ,

I am sorry about the lack of action and late response here. I'm not able to reproduce this. Can you share some more information on how you execute this code? Is it typescript compiled? Optimally it would be nice if you can share an online repo or something like that where it is reproducible.

@hilleer
Copy link
Owner

hilleer commented Mar 3, 2021

@femiveys I am closing this one until further information is provided.

@hilleer hilleer closed this as completed Mar 3, 2021
@ofergoli
Copy link

I think you don't have lsof command installed on your machine.

@alkanna
Copy link

alkanna commented Aug 22, 2023

Running into the same issue on macOS Sonoma 14.0, lsof is installed through brew.

@hilleer hilleer reopened this Aug 23, 2023
@ape-dev-cs
Copy link

ape-dev-cs commented Dec 9, 2023

I can reproduce this on Arch Linux. I can confirm that I have every executable installed & on PATH which is mentioned in the source code.

The full output that I see in my terminal is as follows:

TypeError: dest.end is not a function
 ❯ Socket.onend node:internal/streams/readable:705:10
 ❯ Object.onceWrapper node:events:628:28
 ❯ Socket.emit node:events:526:35
 ❯ endReadableNT node:internal/streams/readable:1359:12
 ❯ processTicksAndRejections node:internal/process/task_queues:82:21

However grepping for "dest.end" in my node_modules folder doesn't yield any results relevant to this module. Interestingly, I only get this error when invoking killPortProcess from inside a beforeAll in a vitest test. Invoking it normally in a TypeScript file doesn't reproduce it.

I'm running Node 18.

I can confirm that we get to Line 69 here and everything's fine: https://github.com/hilleer/kill-port-process/blob/main/src/lib/killer.ts#L69

However, the xargs.on listener on line 70 never fires, and we get the error shown above.

@hilleer
Copy link
Owner

hilleer commented Dec 12, 2023

Hi @ape-dev-cs

Thanks for the well described comment! I will have a look into it at some point. Meanwhile, if you're interested, feel free to have one too and open a PR if you find a fix 🙂

@hilleer hilleer linked a pull request Dec 21, 2023 that will close this issue
@hilleer
Copy link
Owner

hilleer commented Dec 22, 2023

@ape-dev-cs what specific node (18) version are you running to reproduce this? 🙂

@hilleer
Copy link
Owner

hilleer commented Dec 22, 2023

Hi all

I have published a v4 beta. Would it be possible for you to try this one and see if it resolves your problem?

@hilleer hilleer self-assigned this Dec 22, 2023
@TheNextGuy32
Copy link

TheNextGuy32 commented Feb 17, 2024

I get the same error using the beta. I'm on osx Monterey.

@hilleer
Copy link
Owner

hilleer commented Feb 17, 2024

I get the same error using the beta. I'm on osx Monterey.

@TheNextGuy32 thanks for getting back to me here. Can you share also what node version you're using?

@TheNextGuy32
Copy link

18.14.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants