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

VS Code breakpoint with tsx and Nodejs 20.12.0 does not work #506

Closed
4 of 6 tasks
piquark6046 opened this issue Mar 27, 2024 · 20 comments · Fixed by #518
Closed
4 of 6 tasks

VS Code breakpoint with tsx and Nodejs 20.12.0 does not work #506

piquark6046 opened this issue Mar 27, 2024 · 20 comments · Fixed by #518
Labels
bug Something isn't working outdated

Comments

@piquark6046
Copy link

Acknowledgements

  • I searched existing issues to avoid duplicates
  • I understand this is a place to report a confirmed bug (not seek debugging help)
  • I understand this is a collaborative open source project, and relies on community contributions
  • I have read and understood the Contribution guide

Minimal reproduction URL

List-KR/multithread-array#1

Version

4.7.1

Node.js version

20.12.0

Package manager

npm

Operating system

Linux

Problem & expected behavior (under 200 words)

  • What happened: All VS Code breakpoints are ignored

  • What I expected: VS Code breakpoint works as using Node.js 20.11.1

  • Screenshot:

    Screenshot

    image

  • devcontainer.json

    {
        "name": "Typescript with Rust",
        "image": "mcr.microsoft.com/devcontainers/base:ubuntu",
        "features": {
      	  "ghcr.io/devcontainers/features/node:latest": {
      		  "nodeGypDependencies": true,
      		  "version": "lts"
      	  },
      	  "ghcr.io/devcontainers/features/rust:latest": {
      		  "version": "latest",
      		  "profile": "default"
      	  },
      	  "ghcr.io/devcontainers-contrib/features/bash-command:latest": {
      		  "command": "echo hi!"
      	  },
      	  "ghcr.io/devcontainers-contrib/features/npm-package:latest": {
      		  "package": "typescript",
      		  "version": "latest"
      	  },
      	  "ghcr.io/devcontainers-contrib/features/typescript:latest": {
      		  "version": "latest"
      	  },
      	  "devwasm.azurecr.io/dev-wasm/dev-wasm-feature/rust-wasi:latest": {}
        },
        "remoteUser": "root",
        "mounts": [
      	  "source=${localEnv:HOME}/repos/Filters,target=/workspaces/resources/Filters,type=bind,consistency=cached",
      	  "source=${localEnv:HOME}/repos/Userscript,target=/workspaces/resources/Userscript,type=bind,consistency=cached"
        ]
    }

Contributions

  • I will open a pull request for this issue
  • I will support the work financially (any amount helps)
@piquark6046 piquark6046 added bug Something isn't working pending triage labels Mar 27, 2024
@privatenumber privatenumber closed this as not planned Won't fix, can't repro, duplicate, stale Mar 27, 2024
@piquark6046
Copy link
Author

piquark6046 commented Mar 27, 2024

Is the reproduction information not enough?

@privatenumber
Copy link
Owner

privatenumber commented Mar 27, 2024

Took a glance and the first few pages of files I scrolled had nothing to do with tsx or VSCode.
Please keep it minimal as it costs me time to help.

@tenpaMk2
Copy link

Hi @privatenumber . Thank you for developing.

I can reproduce in the minimal project.

VSCode cannot stop at the breakpoints via Node 20.12.0.

However, it can do via Node 20.11.1.
So, I think it's a problem of Node.

  • Mac OS: Sonoma 14.4.1
  • VSCode: February 2024 (version 1.87)
  • Node: 20.12.0
  • tsx: 4.7.1

Both Node 21 and 20 are not working at tsx when debugging...
I think it's too difficult situation for tsx users...

@piquark6046

This comment was marked as off-topic.

@piquark6046

This comment was marked as off-topic.

@privatenumber
Copy link
Owner

Thanks @tenpaMk2

Would you or @piquark6046 be willing to investigate this?

I'm not personally affected by this so I'm unlikely to work on it unless paid to.

@piquark6046

This comment was marked as off-topic.

@piquark6046

This comment was marked as off-topic.

@aslampr07

This comment has been minimized.

@privatenumber
Copy link
Owner

privatenumber commented Apr 2, 2024

@piquark6046

This is a project I work on for fun, primarily to improve my own workflow.

I'm not currently affected by this (maybe in the future), and it makes more sense for those that are affected by it to fix it.

I already donate my time to open source and maintain tsx to help others, and I'm not trying to take on more unpaid work.

I'd be happy to review and help you with your PR though.

@cenfun
Copy link
Contributor

cenfun commented Apr 2, 2024

It seems that the root cause is because inline sourcemap no longer works in nodejs 20.12.0. VSCode debug might not work if there is no inline sourcemap.

Hope this helps you.

@privatenumber
Copy link
Owner

Ah very helpful @cenfun, great work!

Would you be willing to open a PR?

@piquark6046

This comment was marked as off-topic.

@privatenumber

This comment was marked as off-topic.

@bqp-articulate
Copy link

bqp-articulate commented Apr 3, 2024

I can confirm this behavior, and I'll add that I can also reproduce with the tsx smoketests in 20.12. If @cenfun isn't submitting a PR for this, I'd be happy to - I've invested time already wrapping my head around this bit of code and I have a workaround by pinning my environment to node 20.11

@cenfun
Copy link
Contributor

cenfun commented Apr 4, 2024

@bqp-articulate there is PR here #517

@cenfun
Copy link
Contributor

cenfun commented Apr 4, 2024

@privatenumber I create a new PR here #518
Could you please review it?

@piquark6046

This comment was marked as outdated.

@privatenumber
Copy link
Owner

Released in v4.7.2!

Thanks for your contribution @cenfun 🙌!

@bqp-articulate
Copy link

I tested 4.7.2 on my end, works great. Thanks all!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working outdated
Projects
None yet
6 participants