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

TypeScript Language Server incorrectly reports errors in Vue SFC files #2579

Open
chinafzy opened this issue Jan 14, 2025 · 0 comments
Open

Comments

@chinafzy
Copy link

NOTE: We will try our best to check Github Issues, but forum.cursor.com is our main site for bug reports / user feedback. We'd recommend you post there for the fastest response.

TypeScript Language Server incorrectly reports errors in Vue SFC files

Description

The TypeScript language server in Cursor IDE incorrectly reports syntax errors in Vue Single File Components (SFC), specifically in the <script setup lang="ts"> section. These errors are false positives as the same code works perfectly in VSCode with identical configuration and plugins.

Environment

  • OS: macOS 24.2.0
  • Cursor IDE (latest version)
  • Vue 3 + TypeScript + Plasmo browser extension project
  • Vue Language Features (Official) plugin installed and enabled

Error Messages

When editing .vue files, the following false errors are reported:

  • '=' expected.
  • ';' expected.
  • Cannot find name 'App'.
  • Cannot find name 'from'.

Project Configuration

// tsconfig.json
{
"extends": "plasmo/templates/tsconfig.base",
"exclude": ["node_modules"],
"include": [".plasmo/index.d.ts", ".//.ts", ".//.vue"],
"compilerOptions": {
"paths": { "~": ["./"] },
"types": ["vue"],
"baseUrl": "."
}
}

Expected Behavior

  • No TypeScript errors should be reported as the code is valid Vue 3 + TypeScript syntax
  • TypeScript language server should properly recognize Vue SFC syntax and types

Additional Context

  • The same code and configuration work perfectly in VSCode
  • The code compiles and runs correctly despite the IDE errors

Steps to Reproduce

  1. Create a new Vue 3 + TypeScript project
  2. Add a .vue file with <script setup lang="ts"> section
  3. Import Vue types and use TypeScript syntax
  4. Observe incorrect error reporting from the language server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant