tsyringe icon indicating copy to clipboard operation
tsyringe copied to clipboard

Unable to use Tsyringe with tsx

Open mufasa3000 opened this issue 6 months ago • 2 comments

Description Dependancies are not resolved by Tsyringe when running my node.js app with tsx. It all works well with ts-node.

I assume the issue boils down to the "sensible defaults" of tsx. Any guidence on how to set up the tsconfig to make it work with tsx would be much appreciated.

To Reproduce Please see my very simple app that demostrates the issue: https://stackblitz.com/edit/node-pv7jyyb1

  • Run with ts-node: npm run start:ts-node (works)
  • Run with tsx: npm run start:tsx (fails)

Expected behavior DI should work the same with tsx and ts-node

Version: 4.10.0

mufasa3000 avatar Jun 25 '25 09:06 mufasa3000

tsx uses esbuild, which does not suport emitDecoratorMetadata.

DavidReinberger avatar Jul 07 '25 11:07 DavidReinberger

Hello team, thank you for the hard working.

Do you have any update here?

I am with the same problem if I use ts-node does not recognize absolute paths if I use tsx the Tsyringe stop working.

dvelosojob avatar Dec 02 '25 17:12 dvelosojob