leolabs / json-autotranslate

Translate a folder of JSON files containing translations into multiple languages.
MIT License
139 stars 43 forks source link

Error `"path" argument must be of type string. Received undefined` introduced in v1.14.4 #131

Open codeflorist opened 2 weeks ago

codeflorist commented 2 weeks ago

I'm using json-autotranslate with this call:

npx json-autotranslate --source-language en --directory-structure ngx-translate  --type key-based  --decode-escapes --delete-unused-strings --service deepl-free --config <TOKEN>

Using a en.json like this:

{
    "test": "example"
}

This was working fine using v1.14.3.

But with v1.14.4 the following error is thrown:

An error has occurred:
The "path" argument must be of type string. Received undefined
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
    at Object.join (node:path:433:7)
    at DeepL.runTranslation (C:\Users\<USER>\AppData\Local\npm-cache\_npx\c2e5601f47c93b16\node_modules\json-autotranslate\lib\services\deepl.js:230:39)
    at DeepL.translateStrings (C:\Users\<USER>\AppData\Local\npm-cache\_npx\c2e5601f47c93b16\node_modules\json-autotranslate\lib\services\deepl.js:123:43)
    at C:\Users\<USER>\AppData\Local\npm-cache\_npx\c2e5601f47c93b16\node_modules\json-autotranslate\lib\index.js:243:60
    at translate (C:\Users\<USER>\AppData\Local\npm-cache\_npx\c2e5601f47c93b16\node_modules\json-autotranslate\lib\index.js:184:72)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Using npx with the specifix v1.14.3 version (npx json-autotranslate@1.14.3 ...) is a temporary solution.

monsieur-ricky commented 4 days ago

Any news on this issue? What is the root cause?