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

useCssModule is broken on Vue 2.7 #12824

Closed
Ansett opened this issue Oct 12, 2022 · 3 comments
Closed

useCssModule is broken on Vue 2.7 #12824

Ansett opened this issue Oct 12, 2022 · 3 comments

Comments

@Ansett
Copy link

Ansett commented Oct 12, 2022

Version

2.7.11

Reproduction link

codesandbox.io

Steps to reproduce

const style = useCssModule()
console.log(style.someClass) // undefined
// ...
<style module lang="css">
.someClass {
  background: pink;
}
</style>

What is expected?

style object should contain defined class names

What is actually happening?

style object is empty.

In console: [Vue warn]: Current instance does not have CSS module named "$style"


I checked https://github.com/vuejs/core/blob/v2-compat/packages/runtime-dom/src/helpers/useCssModule.ts which uses getCurrentInstance, but on vue 2.7 getCurrentInstance returns { proxy: Vue }.
Maybe that's something else :p

@skirtles-code
Copy link

I believe this is the same issue as #12822.

@Ansett
Copy link
Author

Ansett commented Oct 12, 2022

Seems so, I didn't search well enough :(

@sodatea
Copy link
Member

sodatea commented Oct 12, 2022

Let's close this and track it in #12822 instead.

@sodatea sodatea closed this as not planned Won't fix, can't repro, duplicate, stale Oct 12, 2022
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

3 participants