Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix "Flag 'importsNotUsedAsValues' is deprecated and will stop functioning in TypeScript 5.5."?

Does anybody know how to fix this tsconfig error?

Flag 'importsNotUsedAsValues' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error. Use 'verbatimModuleSyntax' instead.

I use vscode and created new Vue project instance using Vite

Not sure if I should silence this error or there is a specific solution on how to edit tsconfig?

like image 426
Donatas Adomavičius Avatar asked Sep 09 '25 18:09

Donatas Adomavičius


1 Answers

Had the same issue, got it fixed using this workaround from the GitHub issue:

If you're using @vue/tsconfig/tsconfig.web.json or similar, you can reset those properties that are erroring when you enable verbatimModuleSyntax

{
  "extends": "@vue/tsconfig/tsconfig.web.json",
  "compilerOptions": {
    // workaround for https://github.com/vuejs/tsconfig/issues/6
    "preserveValueImports": false,
    "importsNotUsedAsValues": "remove",
    "verbatimModuleSyntax": true,
    // end workaround
  },
}

I saw you used @vue/tsconfig/tsconfig.web.json.

like image 88
djbartolini Avatar answered Sep 13 '25 05:09

djbartolini