question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The project has a syntax error in VSCode

See original GitHub issue

English (Deep translation):

After creating a project with npx degit antfu/vitesse my-vitesse-app and installing all the VSCode dependencies described in README.md, VSCode prompts the error.

image

  1. The module “. /App.vue” or its corresponding type declaration. 2.
  2. The attribute “savedName” does not exist on the type “never”.

I solved the first error by adding a .d.ts file of my own.

declare module '*.vue' {
  import { defineComponent } from 'vue'
  const Component: ReturnType<typeof defineComponent>
  export default Component
}

But the second error is still there, and although it doesn’t affect the operation, I’m having a hard time looking at it, how do I get rid of these errors?

Original Chinese:

使用 npx degit antfu/vitesse my-vitesse-app 创建项目并且安装 README.md 中所描述的所有 VSCode 依赖之后,VSCode 提示错误: image

  1. 找不到模块“./App.vue”或其相应的类型声明。
  2. 类型“never”上不存在属性“savedName”。

我通过自行添加一个 .d.ts 文件解决了第一个错误:

declare module '*.vue' {
  import { defineComponent } from 'vue'
  const Component: ReturnType<typeof defineComponent>
  export default Component
}

但是第二个错误仍然存在,虽然这不影响运行,但是我看着很难受,如何消除这些错误?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:13 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
LittleSoundcommented, Sep 7, 2021

Reloading and reopening the program didn’t work, I tried that. I compressed my project, but its dependency files are too big and exceed the upload limit I uploaded it using Google Drive: https://drive.google.com/file/d/13KpNtzA2K4bqVQWQYZ7_wtNB54IEzw7Y/view?usp=sharing

1reaction
LittleSoundcommented, Sep 7, 2021

So let me summarize the solution to this problem.

  1. Update your VS Code to make sure the version is up to date. The version I was using was a month old and did not work properly with all the plugins needed to run the project
  2. Use the command line pnpm up -latest vue-tsc to update your vue-tac
  3. open Volar: Switch TS plugin on / off in VS Code

After I did the above, both errors were solved without any problems.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Invalid Syntax error when running python from inside Visual ...
Think this is a bug of VS Code. When you use "run selection/line in python terminal" command, VS Code starts python interpreter and...
Read more >
Syntax errors are not displayed C #. · Issue #116291 - GitHub
This issue is caused by an extension, please file it with the repository (or contact) the extension has linked in its overview in...
Read more >
Syntax Validation | PHP Tools for Visual Studio Documentation
This error indicates a problem in a class hierarchy, the class is either missing a parent or the parent keyword should be removed....
Read more >
Debugging in Visual Studio Code
This approach requires that the "<" syntax is passed through the debugger extension and ends up unmodified in the Integrated Terminal. Multi-target debugging....
Read more >
Fix program errors and improve code - Visual Studio (Windows)
Press Ctrl+G to quickly jump to the line number where the error occurred. The error is identified by a red "squiggle" underscore. Hover...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found