#.ts file execution through node no longer working.

1 messages · Page 1 of 1 (latest)

gray oasis
#

that shouldn't be related to vite. What is your node version?

plush bluff
#

Hmm. node has never been able to execute Typescript file natively. Recently there is a new "--experimental-strip-types" flag to support that, so you need to pass that flag I think. Seems like only since Node 22.18.0 is type stripping enabled by default (no flag needed) https://nodejs.org/en/blog/release/v22.18.0

plush bluff
#

Yeah if you use node, I thi j you have to specify extension name when importing. Allowing no-extension when importing is a bundler DX benefit

#

I am surprised you can run typescript file natively before? Are you sure that was "node" and not "ts-node" or "tsx" or "bun", or "vite-node" or running node on the transpiled outout?

#

I would be very surprised if you can replicate that

Vite by itself doesn't change anything about the environment or Nodejs, so Nodejs wouldn't suddenly be able to run Typescript file

#

Very interesting. Would you be able to put the code onto a Github or StackBlitz somewhere, or maybe even a Zip file, along with the Nodejs version of your laptop? I am very curious