Open EtienneGuilletPackative opened 5 months ago
It seems TypeScript file support is in a broken stage at this time and would need some changes (and potential redesign of how it is handled)
For future reference: ts-node seems to not be able to properly hook into Node and the Node docs seem to indicate the proper hooks to bring things back is 20.6.x only, so that option is no longer viable.
The direction to take is probably to do something similar to how Vite loads its config file: simply bundle the file ourselves using typescript
and write it to a temporary location so we can import
it as a plain mjs file - essentially what ts-node was doing but this time it should be way more stable and future proof
I'm not sure this issue is limited to TypeScript. Seems broken on Windows with a .js extractor as well.
Broken on MacOS too ts-node v10.9.2 node.js v20.6.1 tolgee-cli v1.4.0
Also ran into issue on macos and linux. Was able to work around this mess by converting the custom extractor to commonjs (note not ES module, so module.exports = ..., etc.).
Only ran into this problem because the way to programatically delete keys is through running the sync command or writing our own script (not there yet thankfully). Quite a run around 🥴
Hello, Whille running the following command on a Windows env
tolgee sync -e './libraries/common/react-emails/scripts/extractor.ts' './libraries/common/react-emails/**/*.ts?(x)'
I get the following error
I don't have any problem with the CLI on Windows otherwise