Open victor314159 opened 2 months ago
No way, use ts-node
instead.
This is how I fixed it:
"serve": "tsx watch --inspect=0.0.0.0:9229 ./lib/index.ts", // stop using tsx
"serve": "npx concurrently \"tsc --watch\" \"nodemon -L --inspect=0.0.0.0:9229 ./dist/index.js\"", // use tsc --watch option, so Typia works fine
because I'm running in a docker container, the node --watch
wouldn't work, so I've used nodemon
Also added it to tsconfig.json
(because tsc --wtach
wouldn't work otherwise because of the container running on Windows.)
"watchOptions": {
"watchFile": "dynamicPriorityPolling"
}
ts-node
has issues that tsx
elegantly solves for. We use tsx
almost exclusively due to compatibility & pipeline issues with ts-node
which we had to drop support for after a good week of trying to use it.
It's unfortunate if the official stance is that tsx
will never be supported because ts-node
exists. Despite practical and longevity issues with ts-node
😥
Are there ways to work around this problem? We don't even necessarily need it with watch
mode either.
When running vi tsx
, we get:
'Internal Server Error: Error on typia.validate(): no transform has been configured. Read and follow https://typia.io/docs/setup please.',
Despite this setup already being completed.
Edit: Looks like TSX cannot use esbuild plugins . It uses esbuild internally, but cannot make use of plugins from the sound of it.
we can't because tsx uses esbuild's Transform API to process TypeScript, which doesn't support plugins.
Edit 2: https://github.com/privatenumber/pkgroll support might be a partial alternative or use case? Looks like it uses rollup
and esbuild
though :/
Can we use this lib to instead codegen, and we can just consume that generated code with our normal build tools?
Edit: https://typia.io/docs/setup/#generation
Need a way to ass eslint ignores though, so many any
errors.
Big fan of
typia
here, thanks for this amazing lib !I'm trying to use
typia
when starting my backend in development mode withtsx
I use
tsx
because it allows very easy hot reloading when developping.Long story short, typia works fin in production mode (with
tsc
), but I don't know how to make it work withtsx
Is it possible ?