privatenumber / tsx

⚡️ TypeScript Execute | The easiest way to run TypeScript in Node.js
https://tsx.is
MIT License
8.61k stars 132 forks source link

Watcher continues to watch files after removal as dependency (dead imports) #568

Open U-4-E-A opened 4 weeks ago

U-4-E-A commented 4 weeks ago

Acknowledgements

Minimal reproduction URL

https://stackblitz.com/~/github.com/U-4-E-A/tsx-dead-import-test?file=src/server.ts

Problem & expected behavior (under 200 words)

v4.11.2 Node: v21.6.2

When an import is added to a watched file, the file from which the import comes is added to the watch. However, upon removal of the import, the file the import came from continues to be watched, causing false reloads.

Bugs are expected to be fixed by those affected by it

Compensating engineering work financially will speed up resolution