nuxt-modules / color-mode

Dark and Light mode with auto detection made easy with Nuxt 🌗
https://color-mode.nuxtjs.org
MIT License
1.12k stars 112 forks source link

nuxt kit not up to date, cannot auto import `useColorMode()` #175

Closed huang-julien closed 2 years ago

huang-julien commented 2 years ago

Version

@nuxtjs/color-mode: 3.1.8 nuxt: 3.0.0

Reproduction Link

Steps to reproduce

Try to autoimport useColorMode in any composable or component

What is Expected?

It should be imported

What is actually happening?

IDE warns that it is not defined. And a page calling useColorMode will throw an error

Why

in @nuxt/kit rc9, it adds autoimport using autoImports:extend which is deprecated

Can this be exported by the package ? We would be able to import it manually using import { useColorMode } from "@nuxtjs/color-mode"

dargmuesli commented 2 years ago

@Atinux https://github.com/nuxt-modules/color-mode/pull/161 would resolve this issue

danielroe commented 2 years ago

give it a go with v3.2.0 and let me know if it's resolved for you.

huang-julien commented 2 years ago

solved with 3.2.0 ❤️