Skip to content

Instantly share code, notes, and snippets.

@emekaorji
Created March 10, 2026 10:11
Show Gist options
  • Select an option

  • Save emekaorji/78253e502a719a03c83a29333871bdc8 to your computer and use it in GitHub Desktop.

Select an option

Save emekaorji/78253e502a719a03c83a29333871bdc8 to your computer and use it in GitHub Desktop.
symlx: explicit failure for TS targets with node shebang

symlx change request: fail early for TS targets with node shebang

Problem

A TypeScript bin target can currently be direct-linked when it has a shebang, even if that shebang is node. This leads to runtime failures like:

  • ERR_UNKNOWN_FILE_EXTENSION: Unknown file extension ".ts"

for targets such as src/bin/zestman.ts.

Requested change

Add explicit validation and fail early when all conditions are true:

  1. target extension is TypeScript-family: .ts, .tsx, .mts, .cts
  2. target has a shebang
  3. shebang runtime resolves to node

Expected error guidance

Fail with a targeted message that tells the user exactly how to fix it:

  • use #!/usr/bin/env tsx (or equivalent tsx shebang), or
  • remove shebang and let symlx use launcher inference.

Non-goals

  • do not change default hybrid behavior for other targets
  • do not change collision/session/cleanup behavior
  • do not reintroduce shebang mode toggles

Acceptance criteria

  • TS target + node shebang fails before linking
  • TS target + tsx shebang still direct-links successfully
  • TS target without shebang still uses launcher inference
  • JS target + node shebang remains valid direct-link
  • tests cover this scenario in bin target validation and command integration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment