Open Alfagun74 opened 2 years ago
@Alfagun74 we haven't released any updates so far. Have you updated the VS Code itself recently?
@terales im running on the latest version 1.63.2
I think this issue is connected to config parsersTypescriptTsNodePath which expects _nodemodules/ts-node/dist/bin.js. I solved the issue by installing ts-node.
yarn add -D ts-node
However I still wonder how what value I need to provide to use global installation of ts-node.
I also encountered this situation. It happened after upgrading vscode. The current version of vscode is 1.66.2 (Universal). After searching for a long time, I saw this issue and finally ran to the plugin directory [~/.vscode/ extensions/lokalise.i18n-ally-2.8.1/] executed "yarn add -D ts-node", and after retrying, it was successful. It seems that a compatible version still needs to be released, thanks
I had the same issue, but solving it for me was a little more involved: Running yarn add -D ts-node
failed, because yarn couldn't find fluent-vue-cli
. Luckily, removing that dependency didn't seem to break things. Then, I got a new error in my output:
🐛 Failed to load Error: Command failed: node "c:\Users\Qcoret\.vscode\extensions\lokalise.i18n-ally-2.8.1\node_modules\ts-node\dist\bin.js" --dir "c:\Users\Qcoret\Documents\qntn.io" --transpile-only --compiler-options "{\"importHelpers\":false,\"allowJs\":true,\"module\":\"commonjs\"}" "c:\Users\Qcoret\.vscode\extensions\lokalise.i18n-ally-2.8.1\assets\loader.js" "c:\Users\Qcoret\Documents\qntn.io\src\i18n\loader.ts"
c:\Users\Qcoret\.vscode\extensions\lokalise.i18n-ally-2.8.1\node_modules\ts-node\dist-raw\node-internal-errors.js:46
const err = new Error(getErrRequireEsmMessage(filename, parentPath, packageJsonPath))
^
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: c:\Users\Qcoret\Documents\qntn.io\src\scripts\flatten.ts
require() of ES modules is not supported.
require() of c:\Users\Qcoret\Documents\qntn.io\src\scripts\flatten.ts from c:\Users\Qcoret\Documents\qntn.io\src\i18n\loader.ts is an ES module file as it is a .ts file whose nearest parent package.json contains "type": "module" which defines all .ts files in that package scope as ES modules.
Instead change the requiring code to use import(), or remove "type": "module" from c:\Users\Qcoret\Documents\qntn.io\package.json.
I ended up creating a phantom package.json
in my src/i18n
folder, without a "type": "module"
(and immediately added the file to my .gitignore
and vscode ignore). That seems to have resolved the issue, but this certainly seems like something that should/could be fixed on the package level.
In setting the json, you need to set up i18n-ally.parsers.typescript.com pilerOptions values
Describe the bug I18N-Ally cant parse my translation files anymore. I use Svelte and Typescript Translation Files. See Error below.
It used to work before, now it doesnt ¯_(ツ)_/¯.
Extension Version v2.8.1
Framework/i18n package you are using Svelte, Typescript-Parser
Device Infomation
Extension Log Go to
View
->Output
->i18n Ally
, and paste the content below. You should mask any sensitive information