#842·tsx

Parse error in scripts with shebang and dynamic import

Author: jfeingold35Created Sep 16, 2026Updated Sep 16, 2026
Labelsbugpending triage

Acknowledgements

  • I read the documentation and searched existing issues to avoid duplicates
  • I understand this is a bug tracker and anything other than a proven bug will be closed
  • I understand this is a free project and relies on community contributions
  • I read and understood the Contribution guide

Minimal reproduction URL

https://github.com/jfeingold35/tsx-issue-repro-2026-09-16

Problem & expected behavior (under 200 words)

When a script has a dynamic import (await import()) and a shebang (e.g., #!/usr/bin/env -S node --import tsx), a Parse Error occurs.

This is happening because the shebang is not being stripped out before the code is passed into the lexer.

Bugs are expected to be fixed by those affected by it

  • I'm interested in working on this issue

Compensating engineering work will speed up resolution and support the project

  • I'm willing to offer $10 for financial support