Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vue-tsc issue with tsconfig #5010

Open
romanslonov opened this issue Nov 15, 2024 · 2 comments
Open

vue-tsc issue with tsconfig #5010

romanslonov opened this issue Nov 15, 2024 · 2 comments
Labels
question Further information is requested

Comments

@romanslonov
Copy link

romanslonov commented Nov 15, 2024

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 [email protected]: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.

@kortin99
Copy link

Maybe should change code to:

const str = '//'.replace(/\//g, '*')

Or add lib option to compilerOptions in tsconfig.app.json

"compilerOptions": {
  ...
  "lib": ["ES2021", "DOM"]
}

@KazariEX
Copy link
Collaborator

The lib is empty.

image

@KazariEX KazariEX added question Further information is requested and removed pending triage labels Dec 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants