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

Cannot work in .vue file #187

Closed
otomad opened this issue Dec 9, 2022 · 11 comments
Closed

Cannot work in .vue file #187

otomad opened this issue Dec 9, 2022 · 11 comments
Assignees
Labels
question Further information is requested

Comments

@otomad
Copy link

otomad commented Dec 9, 2022

Describe the bug

It can be working properly in *.ts, *.tsx files, but cannot be working in *.vue files.

Screenshots

image
works fine in *.ts

image
works fine in *.tsx

image
cannot work in *.vue, detect as Record<string, string>.

Desktop

  • OS: Windows 11
  • Browser: Edge, Chrome
  • Version: 108.0.5359.99

Additional context

One more thing, if enable VSCode extension TypeScript Vue Plugin (Volar), it will conflict with typescript-plugin-css-modules, and crash the tsserver.

@mrmckeb
Copy link
Owner

mrmckeb commented Dec 11, 2022

Hi there, are you able to provide a simple reproduction for me to test against? I don't work with Vue, but if you can provide a reproduction I should be able to find out what's happening!

@otomad
Copy link
Author

otomad commented Dec 11, 2022

I opened a repository to test typescript-plugin-css-modules in vue.

It works in
*.ts (/src/main.ts),
*.tsx (/src/components/MyJsx.tsx),

and doesn't work in
*.vue (/src/components/HelloWorld.vue).

And if VSCode extenstion TypeScript Vue Plugin (Volar) is enabled, typescript-plugin-css-modules will not work either.

@mrmckeb mrmckeb added the bug Something isn't working label Dec 11, 2022
@mrmckeb
Copy link
Owner

mrmckeb commented Dec 11, 2022

Thank you! I'll try to investigate and find a resolution this week.

@MichaelBitard
Copy link

I think it has something to do with vue-tsc/volar.

See vuejs/language-tools#1128 😢

@aradalvand
Copy link

I'm having the same problem but for .svelte files, so this may something to do with VIte, perhaps — since Vite is the common denominator between Vue and SvelteKit.

@mrmckeb Any updates?

@aradalvand
Copy link

aradalvand commented Jan 10, 2023

@otomad Actually, Volar seems to have an option that lets you change the TypeScript version it uses under the hood; see if changing that to the workspace version fixes your problem.

Open up the command palette (Ctrl/CMD + Shift + P), and find the "Volar: Select TypeScript Version" item:

image

And then choose "Use workspace version":

image

@mrmckeb mrmckeb added this to the v4.2.0 milestone Feb 18, 2023
@mrmckeb mrmckeb self-assigned this Feb 18, 2023
@mrmckeb
Copy link
Owner

mrmckeb commented Feb 18, 2023

Thanks @aradalvand! @otomad can you confirm that this suggestion solves your issue?

@mrmckeb mrmckeb added question Further information is requested and removed bug Something isn't working labels Feb 18, 2023
@mrmckeb mrmckeb removed this from the v4.2.0 milestone Feb 18, 2023
@otomad
Copy link
Author

otomad commented Feb 23, 2023

Thanks @aradalvand! @otomad can you confirm that this suggestion solves your issue?

No, it still doesn't work.

@mrmckeb
Copy link
Owner

mrmckeb commented Mar 11, 2023

I've spent some time digging into this today, and it looks like this is not supported by Volar - as @MichaelBitard said.

Here the author's state that they don't support plugins:
vuejs/language-tools#2153 (comment)

Here they detail why:
vuejs/language-tools#1005 (comment)

I'll have to close this off for now sorry, but would love to help you if I could.

@mrmckeb
Copy link
Owner

mrmckeb commented Mar 11, 2023

@aradalvand if you're still having issues with Svelte, please create a separate ticket/repro repo and I can dig in. It may be a similar issue, but I can investigate.

@mrmckeb mrmckeb closed this as completed Mar 11, 2023
@otomad
Copy link
Author

otomad commented Mar 11, 2023

Well, thank you very much anyway.

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

4 participants