bluelovers / idea-run-typescript

IntelliJ IDEA (and WebStorm...) plugin to support 'TypeScript' as a run configuration
https://plugins.jetbrains.com/plugin/10841-run-configuration-for-typescript
76 stars 14 forks source link

[bug] unknown reason debug process start twice #17

Open bluelovers opened 4 years ago

bluelovers commented 4 years ago

currently this bug only happen for me

https://github.com/bluelovers/idea-run-typescript/pull/14#issuecomment-678684547

https://github.com/bluelovers/idea-run-typescript/pull/14#issuecomment-678695824

https://github.com/bluelovers/idea-run-typescript/pull/14#issuecomment-678802907

bluelovers commented 4 years ago

bug is by esm-ts-node

Garethp commented 4 years ago

How do you reproduce this? How to use esm-ts-node? Re-open this ticket, I'll try to help

bluelovers commented 4 years ago

image

Garethp commented 4 years ago

Only run once for me, but debug not working

Garethp commented 4 years ago

I know what's wrong. Getting debug message twice is correct with esm-ts-node. Only runs once, but debug connects twice.

  1. Debug connects to main process
  2. esm-ts-node creates a child process
  3. Debug connects to child process.

One run, two messages

bluelovers commented 4 years ago

looks like can't fix this by delete NODE_OPTIONS lol, it will make debug point not work

Garethp commented 4 years ago

How about not using esm-ts-node? When you have debug with esm-ts-node selected, you can instead run node -r esm -r ts-node/register directly