vuejs / language-tools

⚡ High-performance Vue language tooling based-on Volar.js
https://marketplace.visualstudio.com/items?itemName=Vue.volar
MIT License
5.87k stars 402 forks source link

vue-tsc issue with tsconfig #5010

Open romanslonov opened 6 days ago

romanslonov commented 6 days ago

Vue - Official extension or vue-tsc version

2.1.10

VSCode version

1.95.3

Vue version

3.5.12

TypeScript version

5.6.3

System Info

System:
    OS: macOS 15.1
    CPU: (10) arm64 Apple M1 Pro
    Memory: 219.75 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.11.0 - ~/.nvm/versions/node/v20.11.0/bin/node
    Yarn: 1.22.22 - ~/.nvm/versions/node/v20.11.0/bin/yarn
    npm: 10.3.0 - ~/.nvm/versions/node/v20.11.0/bin/npm
    pnpm: 9.12.3 - ~/Library/pnpm/pnpm
  Browsers:
    Chrome: 130.0.6723.70
    Safari: 18.1

package.json dependencies

{
  "dependencies": {
    "vue": "^3.5.12",
    "vue-router": "^4.4.5"
  },
  "devDependencies": {
    "@playwright/test": "^1.48.2",
    "@tsconfig/node22": "^22.0.0",
    "@types/jsdom": "^21.1.7",
    "@types/node": "^22.9.0",
    "@vitejs/plugin-vue": "^5.1.4",
    "@vitest/eslint-plugin": "1.1.7",
    "@vue/eslint-config-prettier": "^10.1.0",
    "@vue/eslint-config-typescript": "^14.1.3",
    "@vue/test-utils": "^2.4.6",
    "@vue/tsconfig": "^0.5.1",
    "eslint": "^9.14.0",
    "eslint-plugin-playwright": "^2.0.0",
    "eslint-plugin-vue": "^9.30.0",
    "jsdom": "^25.0.1",
    "npm-run-all2": "^7.0.1",
    "prettier": "^3.3.3",
    "typescript": "~5.6.3",
    "vite": "^5.4.10",
    "vite-plugin-vue-devtools": "^7.5.4",
    "vitest": "^2.1.4",
    "vue-tsc": "^2.1.10"
  }
}

Steps to reproduce

git clone git@github.com:romanslonov/vite-vue-webstorm-issue.git
cd vite-vue-webstorm-issue
pnpm i
pnpm type-check

What is expected?

No errors by running vue-tsc --build --force.

What is actually happening?

> vue-tsc --build --force

src/App.vue:5:18 - error TS2550: Property 'replaceAll' does not exist on type '"//"'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2021' or later.

5 const str = '//'.replaceAll('/', '*')

Link to minimal reproduction

https://github.com/romanslonov/vite-vue-webstorm-issue

Any additional comments?

Hello everyone,

I started new vue project using npm create vite@latest and faced some issues with vue-tsc. Initially I thought it bug with vue-language-service but it has same error running vue-tsc.