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

[bug] when compiling with @swc/core (emitDecoratorMetadata enabled) VSCode debug breakpoints set in TS code are not picked up by the debugger #603

Closed
favna opened this issue Apr 3, 2022 · 2 comments
Labels

Comments

@favna
Copy link

favna commented Apr 3, 2022

When having emitDecoratorMetadata enabled and @swc/core installed the resulting bundle that gets produced by tsup will for unknown reason not work properly when debugging in VSCode

I have made a simple reproduction repo: https://github.com/favna/improved-palm-tree
Steps to reproduce:

  1. Clone repo
  2. Go into the with-swc and without-swc folders either sequentially or in different terminal tabs
  3. Run yarn to install modules
  4. Run yarn build to compile TS code
  5. In both folders open src/index.ts and set a VSCode breakpoint on line 2
  6. Go to the debugger tab in VSCode, here you will be able to select 2 predefined debug configs (configured in .vscode/launch.json):
    image
  7. First launch the version without swc, you should now get stopped on the breakpoint:
    image
  8. Kill it and launch the version with swc, you are not stopped on the breakpoint and the process exits, detaching the debugger

This is really quite annoying because being able to just set breakpoints in TS code is super super useful, while on the flip side using @swc/core is AFAIK a must-have when emitDecoratorMetadata is also required for the project.

@egoist egoist closed this as completed in 637ec28 Apr 3, 2022
@github-actions
Copy link

github-actions bot commented Apr 3, 2022

🎉 This issue has been resolved in version 5.12.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

@favna
Copy link
Author

favna commented Apr 3, 2022

Wow that was a quick fix! Tyvm!

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

1 participant