TS parser not working anymore (TS5095: Unable to compile TypeScript)
See original GitHub issueDescribe 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
- OS: Windows 11
- Version: 22000.376
- VS Code Version: 1.63.2
Extension Log
Go to View -> Output -> i18n Ally, and paste the content below. You should mask any sensitive information
πΆ Activated, v2.8.1
ββββββ
πΌ Workspace root changed to "c:\project"
π Enabled
π§© Enabled frameworks: Svelte
𧬠Enabled parsers: ts
π Telemetry id: 2a7c1185-c100-48f4-8684-b148e8ffe963
π Initializing loader "c:\project"
π Directory structure: file
π Path Matcher Regex: /^(?<locale>[\w-_]+)\.(?<ext>ts)$/
π Loading locales under c:\project\src\i18n
π Loading (de) de.ts [1639728684800.5498]
π Failed to load Error: Command failed: node "c:\Users\Someone\.vscode\extensions\lokalise.i18n-ally-2.8.1\node_modules\ts-node\dist\bin.js" --dir "c:\project" --transpile-only --compiler-options "{\"importHelpers\":false,\"allowJs\":true,\"module\":\"commonjs\"}" "c:\Users\Someone\.vscode\extensions\lokalise.i18n-ally-2.8.1\assets\loader.js" "c:\project\src\i18n\de.ts"
c:\Users\Someone\.vscode\extensions\lokalise.i18n-ally-2.8.1\node_modules\ts-node\src\index.ts:513
return new TSError(diagnosticText, diagnosticCodes)
^
TSError: β¨― Unable to compile TypeScript:
error TS5095: Option 'preserveValueImports' can only be used when 'module' is set to 'es2015' or later.
at createTSError (c:\Users\Someone\.vscode\extensions\lokalise.i18n-ally-2.8.1\node_modules\ts-node\src\index.ts:513:12)
at reportTSError (c:\Users\Someone\.vscode\extensions\lokalise.i18n-ally-2.8.1\node_modules\ts-node\src\index.ts:517:19)
at getOutput (c:\Users\Someone\.vscode\extensions\lokalise.i18n-ally-2.8.1\node_modules\ts-node\src\index.ts:955:34)
at Object.compile (c:\Users\Someone\.vscode\extensions\lokalise.i18n-ally-2.8.1\node_modules\ts-node\src\index.ts:968:32)
at Module.m._compile (c:\Users\Someone\.vscode\extensions\lokalise.i18n-ally-2.8.1\node_modules\ts-node\src\index.ts:1056:42)
at Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Object.require.extensions.<computed> [as .js] (c:\Users\Someone\.vscode\extensions\lokalise.i18n-ally-2.8.1\node_modules\ts-node\src\index.ts:1059:12)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Error: TSError: Unable to compile TypeScript - Stack Overflow
First I remove ts-node and typescript from package.json . then, ... If only the npm install -g typescript doesn't work.
Read more >Compile and build TypeScript code using NuGet
Learn how to add TypeScript support to your Visual Studio projects by using the NuGet package.
Read more >How to Set Up a Node.js Project with TypeScript
Compiling TypeScript Files for Node.js. Go ahead and create the aforementioned src directory in your project root, and place a main.ts fileΒ ...
Read more >Babel vs. TypeScript: Choosing the right compiler for your ...
Previously, this meant that Babel did not support TypeScript features that ... you should be able to compile all valid TypeScript codebases.
Read more >TypeScript - webpack
In this guide we will learn how to integrate TypeScript with webpack. Basic Setup. First install the TypeScript compiler and loader by running:...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@terales im running on the latest version 1.63.2
I had the same issue, but solving it for me was a little more involved: Running
yarn add -D ts-nodefailed, because yarn couldnβt findfluent-vue-cli. Luckily, removing that dependency didnβt seem to break things. Then, I got a new error in my output:I ended up creating a phantom
package.jsonin mysrc/i18nfolder, without a"type": "module"(and immediately added the file to my.gitignoreand vscode ignore). That seems to have resolved the issue, but this certainly seems like something that should/could be fixed on the package level.