In server's package.json, use type: "module".
...
after changing some other things to work (such as using file names with .ts/.js extension, and tsconfig changes), found two solutions with down sides:
- Use "tsx" npm package. But gives error when importing the tsconfig paths on node 24 (works on node 20).
- Use ts-node esm loader (node --loader ts-node/esm). But can't see error stack
In server's package.json, use type: "module".
...
after changing some other things to work (such as using file names with .ts/.js extension, and tsconfig changes), found two solutions with down sides: