Skip to content

TypeScript + CSS Modules in Options API #4788

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

Closed
DirectorRen-TV opened this issue Sep 2, 2024 · 0 comments · Fixed by #4790
Closed

TypeScript + CSS Modules in Options API #4788

DirectorRen-TV opened this issue Sep 2, 2024 · 0 comments · Fixed by #4790
Labels
bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first

Comments

@DirectorRen-TV
Copy link

Vue - Official extension or vue-tsc version

v2.1.4

VSCode version

1.92.2

Vue version

3.4.38

TypeScript version

5.5.4

System Info

System:
    OS: Windows 10 10.0.19045
    CPU: (8) x64 Intel(R) Core(TM) i7-7700 CPU @ 3.60GHz     
    Memory: 37.74 GB / 63.94 GB
  Binaries:
    Node: 20.10.0 - C:\Programs\nodejs\node.EXE
    Yarn: 1.22.19 - C:\Programs\Yarn\bin\yarn.CMD
    npm: 10.2.3 - C:\Programs\nodejs\npm.CMD
    pnpm: 8.12.0 - ~\AppData\Local\pnpm\pnpm.EXE
  Browsers:
    Edge: Spartan (44.19041.1266.0), Chromium (127.0.2651.74)
    Internet Explorer: 11.0.19041.1566

package.json dependencies

No response

Steps to reproduce

  1. Create new vue-latest project with TypeScript enabled
  2. Go to App.vue
  3. Add some variable to script and use it in template. Hover this variable in template and watch that its type is correct.
  4. Add scoped attribute to <style> and recheck type of variable in template.
  5. Change scoped to module and recheck type.
  6. Rewrite Composition API syntax to Options API and check type of variable in template with scoped and with module styles.

What is expected?

Variable type in template is correct

What is actually happening?

In Options API with CSS Modules all types in template fall to any

Link to minimal reproduction

https://github.com/DirectorRen-TV/repro-volar-optionsapi-ts-cssmodules

Any additional comments?

This working correctly in Volar 2.0.28

@KazariEX KazariEX added bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first 🍰 p2-nice-to-have and removed pending triage labels Sep 2, 2024
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants