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

Strange output at the end of the js file debug #1370

Open
wesleybl opened this issue Oct 16, 2023 · 4 comments
Open

Strange output at the end of the js file debug #1370

wesleybl opened this issue Oct 16, 2023 · 4 comments

Comments

@wesleybl
Copy link

wesleybl commented Oct 16, 2023

Sometimes, I get a strange output in the console at the end of debugging. The output is:

Debug server listening at 127.0.0.1:44301
{
  seq: 286,
  type: 'response',
  request_seq: 13,
  command: 'disconnect',
  success: true,
  body: {}
}
{
  seq: 287,
  type: 'response',
  request_seq: 14,
  command: 'disconnect',
  success: true,
  body: {}
}
{
  seq: 11,
  type: 'response',
  request_seq: 8,
  command: 'disconnect',
  success: true,
  body: {}
}
node:events:495
      throw er; // Unhandled 'error' event
      ^

Error: This socket has been ended by the other party
    at Socket.writeAfterFIN [as write] (node:net:569:14)
    at iv.send (/home/user/Programas/eclipse/plugins/org.eclipse.wildwebdeveloper_1.1.2.202310160731/js-debug/src/dapDebugServer.js:148:162)
    at df._send (/home/user/Programas/eclipse/plugins/org.eclipse.wildwebdeveloper_1.1.2.202310160731/js-debug/src/dapDebugServer.js:91:4596)
    at df._onMessage (/home/user/Programas/eclipse/plugins/org.eclipse.wildwebdeveloper_1.1.2.202310160731/js-debug/src/dapDebugServer.js:91:5086)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Emitted 'error' event on Socket instance at:
    at emitErrorNT (node:internal/streams/destroy:151:8)
    at emitErrorCloseNT (node:internal/streams/destroy:116:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  code: 'EPIPE'
}

Node.js v18.18.0

It is important to note that this error is not shown every time. Sometimes it happens, sometimes it doesn't.

Steps to reproduce:

  • Create a js file with the following code:
console.log("test")
  • Put a breakpoint in the console.log line
  • Right click on the file body.
  • Select "Debug As -> Node program"
  • Press f8 to continue the debug
  • Repeat the debug several times

Sometimes the error is not shown. Sometimes only the json is shown. Sometimes only console.log output is shown.

I hope that every time the debug occurs, only the console.log output is shown.

It appears that some process is trying to write in a socket but it has already been terminated.

@mickaelistria
Copy link
Contributor

Thanks for reporting. Indeed, termination is too abrupt and socket is closed too early.

@wesleybl
Copy link
Author

wesleybl commented May 7, 2024

@mickaelistria now no error appears in the console. Only appears:

Debug server listening at 127.0.0.1:37139
{
  seq: 244,
  type: 'response',
  request_seq: 14,
  command: 'disconnect',
  success: true,
  body: {}
}

Is this expected?

But the biggest problem is that it clears the program execution log. Nothing that console.log prints stays on the screen.

@wesleybl
Copy link
Author

wesleybl commented May 7, 2024

I think @AndrewFerr tried to solve this here: #1372

Does this error still occur to you?

@wesleybl
Copy link
Author

wesleybl commented May 7, 2024

@mickaelistria @AndrewFerr In fact, the output is in another console. The console on the screen shows:

Debug server listening at 127.0.0.1:37139
{
  seq: 244,
  type: 'response',
  request_seq: 14,
  command: 'disconnect',
  success: true,
  body: {}
}

And another unselected console shows:

/home/user/Programas/eclipse/.node/node-v20.12.1-linux-x64/bin/node ./teste.js
Debugger attached.
test
Waiting for the debugger to disconnect...

To see the second console, I need to select it from the Display Selected Console icon.

Is there a possibility that the console displayed after debug is the second one, with the console.log outputs?

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

No branches or pull requests

2 participants