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

Extension Throws Exception at Activation in New Component Files #4457

Closed
CristopherH95 opened this issue Jun 10, 2024 · 3 comments
Closed

Extension Throws Exception at Activation in New Component Files #4457

CristopherH95 opened this issue Jun 10, 2024 · 3 comments
Labels
bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first upstream

Comments

@CristopherH95
Copy link

Vue - Official extension or vue-tsc version

2.0.21

VSCode version

1.90.0

Vue version

3.4.21

TypeScript version

5.4.0

System Info

No response

Steps to reproduce

  1. Create a new project, such as those generated by npm create vue@latest.
  2. Add a devcontainer.json file in a .devcontainer in the root of the project, configured to provide a Node.js and Typescript environment and install the Vue - Official extension.
  3. Reopen the project in the DevContainer.
  4. Install dependencies specified in package.json.
  5. The installed Vue - Official extension appears to work, with IntelliSense running and utilities like "go to definition" working as expected.
  6. Attempt to create a new single file component (e.g., MyTest.vue).
  7. The Vue - Official extension appears to no longer work completely as expected in the new component file (e.g., if importing an existing component, there is no auto-import and "go to definition" does not work).
  8. Observe that the extension now reports uncaught errors during activation.

Link to minimal reproduction

https://github.com/CristopherH95/Vue-Extension-Issue

Any additional comments?

This issue was originally encountered while using Podman with a DevContainer environment for a Vuetify project. This also seemed to occur for me the same in a "vanilla" Vue project such as one in the provided GitHub repo. Upon a quick test, it looks like I also run into this outside of the DevContainer as well.

Examples of errors seen:
Screenshot 2024-06-10 090304
Screenshot 2024-06-10 090328

@so1ve so1ve added bug Something isn't working upstream good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first labels Jun 10, 2024
@johnsoncodehk
Copy link
Member

The issue of creating a new file seems to be related to #4424.
The source code of the thrown error (TypeError: Cannot read properties of undefined (reading 'match')) is https://github.com/volarjs/volar.js/blob/a59765125bb02f1ea62bedd8e3db2a88433538ba/packages/vscode/lib/features/autoInsertion.ts#L63, which is related to auto insertion, I think it's a different issue.

@litingyes
Copy link

The issue of creating a new file seems to be related to #4424. The source code of the thrown error (TypeError: Cannot read properties of undefined (reading 'match')) is https://github.com/volarjs/volar.js/blob/a59765125bb02f1ea62bedd8e3db2a88433538ba/packages/vscode/lib/features/autoInsertion.ts#L63, which is related to auto insertion, I think it's a different issue.

so how to avoid the error about Cannot read properties of undefined (reading 'match')

@wsndshx
Copy link

wsndshx commented Jun 20, 2024

我也遇到了相同的问题,当出现该问题时,插件 ts-plugin 的纠错功能将失效,并且会卡住一些任务的线程。
I encountered the same issue. When this problem occurs, the error correction function of the plugin ts-plugin will fail, and it will hang some threads of tasks.

例如格式化功能会需要长达数秒的时间才能完成,git无法检测文件变更等...
For example, the formatting function takes several seconds to complete, and Git cannot detect file changes, etc...

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first upstream
Projects
None yet
Development

No branches or pull requests

5 participants